Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"watch": "npm run compile && npm-run-all -p watch:*",
"watch:extension": "npm run compile:extension -- -watch",
"watch:extension-bundles": "webpack --mode development --watch",
"pretest": "npm run compile",
"pretest": "cross-env SEGMENT_KEY=test-segment-key npm run compile",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to set this in both places?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the env variable gets baked into the config file at compile time, and there is a unit tests which checks the env values against the config file value, so the answer is yes, we do need it in both places. Alternatively, we can just skip the test that makes that check.

"test": "npm run test-webview && npm run test-extension",
"test-extension": "cross-env NODE_OPTIONS=--no-force-async-hooks-checks xvfb-maybe node ./out/test/runTest.js",
"test-webview": "mocha -r ts-node/register --grep=\"${MOCHA_GREP}\" --file ./src/test/setup-webview.ts src/test/suite/views/webview-app/**/*.test.tsx",
Expand Down
4 changes: 4 additions & 0 deletions src/test/suite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import MDBExtensionController from '../../mdbExtensionController';
import { ExtensionContextStub } from './stubs';
import { mdbTestExtension } from './stubbableMdbExtension';

if (!process.env.SEGMENT_KEY) {
process.env.SEGMENT_KEY = 'test-segment-key';
}

export async function run(): Promise<void> {
const reporterOptions = {
spec: '-',
Expand Down
Loading