We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 912136c commit 1bba058Copy full SHA for 1bba058
1 file changed
src/01.03-programmatic-skip.test.js
@@ -0,0 +1,20 @@
1
+import { test } from "node:test";
2
+import assert from "node:assert/strict";
3
+
4
+test(
5
+ "skips using config if environment variable is missing",
6
+ { skip: !process.env.REQUIRED_ENV_VARIABLE },
7
+ () => {
8
+ assert.fail("if we get here, we need REQUIRED_ENV_VARIABLE and fail");
9
+ },
10
+);
11
12
+test("skips programmatically if environment variable is missing", (t) => {
13
+ if (!process.env.REQUIRED_ENV_VARIABLE) {
14
+ return t.skip("REQUIRED_ENV_VARIABLE is missing");
15
+ }
16
17
+ assert.fail(
18
+ 'If we got here the ".failing" modifier would not be satisfied since the test passed',
19
+ );
20
+});
0 commit comments