nodejs/test/parallel/test-runner-typechecking.js
cjihrig 96718268fe test_runner: remove promises returned by test()
This commit updates the test() and suite() APIs to no longer
return a Promise.

Fixes: https://github.com/nodejs/node/issues/51292
PR-URL: https://github.com/nodejs/node/pull/56664
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-01-31 12:56:02 -08:00

27 lines
968 B
JavaScript

'use strict';
require('../common');
// Return type of shorthands should be consistent
// with the return type of test
const assert = require('assert');
const { test, describe, it } = require('node:test');
const testOnly = test('only test', { only: true });
const testTodo = test('todo test', { todo: true });
const testSkip = test('skip test', { skip: true });
const testOnlyShorthand = test.only('only test shorthand');
const testTodoShorthand = test.todo('todo test shorthand');
const testSkipShorthand = test.skip('skip test shorthand');
describe('\'node:test\' and its shorthands should return the same', () => {
it('should return undefined', () => {
assert.strictEqual(testOnly, undefined);
assert.strictEqual(testTodo, undefined);
assert.strictEqual(testSkip, undefined);
assert.strictEqual(testOnlyShorthand, undefined);
assert.strictEqual(testTodoShorthand, undefined);
assert.strictEqual(testSkipShorthand, undefined);
});
});