runOnly
If shouldRunOnlyTests
is truthy, the test context will only run tests that have the only
option set. Otherwise, all tests are run. If Node.js was not started with the --test-only
command-line option, this function is a no-op.
test('top level test', (t) => {
// The test context can be set to run subtests with the 'only' option.
t.runOnly(true);
return Promise.all([
t.test('this subtest is now skipped'),
t.test('this subtest is run', { only: true }),
]);
});
Content copied to clipboard
Since
v18.0.0, v16.17.0
Parameters
shouldRunOnlyTests
Whether or not to run only
tests.