Skip to content

Commit 1625fa7

Browse files
authored
chore: update telemetry test not to fail without key VSCODE-517 (#1169)
1 parent 129e41e commit 1625fa7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

scripts/generate-constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ const ui = ora('Generate constants file').start();
1313

1414
config({ path: resolve(__dirname, '../.env') });
1515

16+
const segmentKey = process.env.SEGMENT_KEY || 'test-segment-key';
17+
1618
(async () => {
1719
await writeFile(
1820
`${ROOT_DIR}/constants.json`,
19-
JSON.stringify({ segmentKey: process.env.SEGMENT_KEY }, null, 2),
21+
JSON.stringify({ segmentKey }, null, 2),
2022
);
2123
ui.succeed('The constants file has been generated');
2224
})().catch((error) => {

src/test/suite/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import MDBExtensionController from '../../mdbExtensionController';
77
import { ExtensionContextStub } from './stubs';
88
import { mdbTestExtension } from './stubbableMdbExtension';
99

10+
if (!process.env.SEGMENT_KEY) {
11+
process.env.SEGMENT_KEY = 'test-segment-key';
12+
}
13+
1014
export async function run(): Promise<void> {
1115
const reporterOptions = {
1216
spec: '-',

0 commit comments

Comments
 (0)