Skip to content

Commit

Permalink
chore: unify snapshot behavior on CI and local testing (#224)
Browse files Browse the repository at this point in the history
* chore: show snapshot configuration at the start of testing

* chore: unify snapshot behavior on CI and local testing
  • Loading branch information
byCedric committed Sep 4, 2023
1 parent 0bd601d commit bdd2efe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
"--disable-extensions"
],
"env": {
"CI": "true", // Force snapshots into "no update" mode
"UPDATE_SNAPSHOT": null, // Force snapshots into "no update" mode
"VSCODE_EXPO_DEBUG": "vscode-expo*",
"VSCODE_EXPO_TELEMETRY_KEY": null
},
Expand All @@ -73,6 +75,8 @@
"--disable-extensions"
],
"env": {
"CI": "true", // Force snapshots into "no update" mode
"UPDATE_SNAPSHOT": null, // Force snapshots into "no update" mode
"VSCODE_EXPO_DEBUG": "vscode-expo*",
"VSCODE_EXPO_TELEMETRY_KEY": null,
"VSCODE_EXPO_TEST_PATTERN": "${fileBasenameNoExtension}"
Expand All @@ -94,6 +98,8 @@
"--disable-extensions"
],
"env": {
"CI": "true", // Force snapshots into "no update" mode
"UPDATE_SNAPSHOT": null, // Force snapshots into "no update" mode
"VSCODE_EXPO_DEBUG": "vscode-expo*",
"VSCODE_EXPO_TELEMETRY_KEY": null
},
Expand All @@ -114,6 +120,8 @@
"--disable-extensions"
],
"env": {
"CI": "true", // Force snapshots into "no update" mode
"UPDATE_SNAPSHOT": null, // Force snapshots into "no update" mode
"VSCODE_EXPO_DEBUG": "vscode-expo*",
"VSCODE_EXPO_TELEMETRY_KEY": null
},
Expand All @@ -133,9 +141,10 @@
"--disable-extensions"
],
"env": {
"CI": null, // Force snapshots into "update" mode
"UPDATE_SNAPSHOT": "true", // Force snapshots into "update" mode
"VSCODE_EXPO_DEBUG": "vscode-expo*",
"VSCODE_EXPO_TELEMETRY_KEY": null,
"UPDATE_SNAPSHOT": "true"
},
"outFiles": [
"${workspaceFolder}/out/**/*.js"
Expand Down
6 changes: 6 additions & 0 deletions test/mocha/vscode-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ export async function run() {

// Globally initialize the test environment
tests.globalSetup(async function before() {
// Show the snapshot configuration
console.log(
'Snapshot updates:',
require('mocha-chai-jest-snapshot/dist/helper').snapshotOptions.updateSnapshot
);

// Configure Chai extensions
Chai.use(require('chai-subset'));
Chai.use(
Expand Down

0 comments on commit bdd2efe

Please sign in to comment.