Skip to content

Commit

Permalink
test(e2e): add ability to skip v8-compat API tests with env var
Browse files Browse the repository at this point in the history
if you specify SKIP_COMPAT_TESTS as an environment variable,
it will define a global, and then you can use that along with
a conditional on a test suite describe (for example) to skip
an entire suite
  • Loading branch information
mikehardy committed Jun 7, 2024
1 parent b314dac commit c56275e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
"tests:android:build:windows": "cd tests && yarn detox build --configuration android.emu.debug.windows",
"tests:android:build-release": "cd tests && yarn detox build --configuration android.emu.release",
"tests:android:test": "yarn tests:android:emulator:forward && cd tests && yarn detox test --configuration android.emu.debug",
"tests:android:test-no-compat": "yarn tests:android:emulator:forward && cd tests && SKIP_COMPAT_TESTS=true yarn detox test --configuration android.emu.debug",
"tests:android:test:windows": "cd tests && yarn detox test --configuration android.emu.debug",
"tests:android:test:debug": "yarn tests:android:emulator:forward && cd tests && yarn detox test --configuration android.emu.debug --inspect",
"tests:android:test-reuse": "yarn tests:android:emulator:forward && cd tests && yarn detox test --configuration android.emu.debug --reuse",
"tests:android:test-reuse-no-compat": "yarn tests:android:emulator:forward && cd tests && SKIP_COMPAT_TESTS=true yarn detox test --configuration android.emu.debug --reuse",
"tests:android:test-cover": "yarn tests:android:emulator:forward && cd tests && ./node_modules/.bin/nyc yarn detox test --configuration android.emu.debug",
"tests:android:test-cover-reuse": "yarn tests:android:emulator:forward && cd tests && ./node_modules/.bin/nyc yarn detox test --configuration android.emu.debug --reuse",
"tests:android:test:jacoco-report": "cd tests/android && ./gradlew jacocoAndroidTestReport",
Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,8 @@ Object.defineProperty(global, 'mlModular', {
});

global.isCI = !!process.env.CI;
global.skipCompatTests = !!process.env.SKIP_COMPAT_TESTS;
if (skipCompatTests) {
console.warn('WARNING: Skipping v8 API compatibility tests.');
console.warn('WARNING: Run full test suite before trusting results.');
}

0 comments on commit c56275e

Please sign in to comment.