From fc4f5f918cc87bb9f62863917712a5a2257e2a53 Mon Sep 17 00:00:00 2001 From: Steve Hetzel Date: Tue, 24 Feb 2026 10:20:06 -0700 Subject: [PATCH] fix: override productFeatureId and add test --- package.json | 1 + test/pft-telemetry.test.ts | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/pft-telemetry.test.ts diff --git a/package.json b/package.json index c00fdff..f7fa6bd 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "bugs": "https://github.com/forcedotcom/cli/issues", "enableO11y": true, "o11yUploadEndpoint": "https://794testsite.my.site.com/byolwr/webruntime/log/metrics", + "productFeatureId": "aJCEE0000007rcH4AQ", "dependencies": { "@inquirer/core": "^10.3.2", "@inquirer/prompts": "^7.10.1", diff --git a/test/pft-telemetry.test.ts b/test/pft-telemetry.test.ts new file mode 100644 index 0000000..9c43d74 --- /dev/null +++ b/test/pft-telemetry.test.ts @@ -0,0 +1,33 @@ +/* + * Copyright 2026, Salesforce, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { readFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; + +describe('PFT telemetry configuration', () => { + it('package.json has enableO11y and productFeatureId override', () => { + const fileDir = dirname(fileURLToPath(import.meta.url)); + const packageJsonPath = join(fileDir, '..', 'package.json'); + const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as Record; + + expect(packageJson?.enableO11y, 'enableO11y should be true for PFT telemetry').to.equal(true); + expect(packageJson?.productFeatureId, 'productFeatureId should be aJCEE0000007rcH4AQ').to.equal( + 'aJCEE0000007rcH4AQ' + ); + }); +});