| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 312ebd9 commit 7dfa475
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,32 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const { strictEqual } = require('node:assert'); | ||
| 4 | + const { run, suite, test } = require('node:test'); | ||
| 5 | + | ||
| 6 | + if (!process.env.NODE_TEST_CONTEXT) { | ||
| 7 | + const stream = run({ files: [__filename] }); | ||
| 8 | + | ||
| 9 | + stream.on('test:fail', common.mustNotCall()); | ||
| 10 | + stream.on('test:pass', common.mustCall((event) => { | ||
| 11 | + strictEqual(event.skip, true); | ||
| 12 | + strictEqual(event.todo, undefined); | ||
| 13 | + }, 4)); | ||
| 14 | + } else { | ||
| 15 | + test('test options only', { skip: true, todo: true }, common.mustNotCall()); | ||
| 16 | + | ||
| 17 | + test('test context calls only', common.mustCall((t) => { | ||
| 18 | + t.todo(); | ||
| 19 | + t.skip(); | ||
| 20 | + })); | ||
| 21 | + | ||
| 22 | + test('todo test with context skip', { todo: true }, common.mustCall((t) => { | ||
| 23 | + t.skip(); | ||
| 24 | + })); | ||
| 25 | + | ||
| 26 | + // Note - there is no test for the skip option and t.todo() because the skip | ||
| 27 | + // option prevents the test from running at all. This is verified by other | ||
| 28 | + // tests. | ||
| 29 | + | ||
| 30 | + // Suites don't have the context methods, so only test the options combination. | ||
| 31 | + suite('suite options only', { skip: true, todo: true }, common.mustNotCall()); | ||
| 32 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments