Skip to content

Commit 0bcfae3

Browse files
fixup!: restore assert.ok includes to test & separate global setup
1 parent a4aca94 commit 0bcfae3

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const test = require('node:test');
2+
3+
test.before(() => console.log('before(): global'));
4+
test.beforeEach(() => console.log('beforeEach(): global'));
5+
test.after(() => console.log('after(): global'));
6+
test.afterEach(() => console.log('afterEach(): global'));

test/fixtures/test-runner/no-isolation/global-hooks.js

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import test from 'node:test';
2+
3+
test.before(() => console.log('before(): global'));
4+
test.beforeEach(() => console.log('beforeEach(): global'));
5+
test.after(() => console.log('after(): global'));
6+
test.afterEach(() => console.log('afterEach(): global'));

test/parallel/test-runner-no-isolation-hooks.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ const order = [
4848
test('Using --require to define global hooks works', async (t) => {
4949
const { stdout } = await common.spawnPromisified(process.execPath, [
5050
...testArguments,
51-
'--require', fixtures.path('test-runner', 'no-isolation', 'global-hooks.js'),
51+
'--require', fixtures.path('test-runner', 'no-isolation', 'global-hooks.cjs'),
5252
...testFiles,
5353
]);
5454

55-
t.assert.equal(stdout, order);
55+
t.assert.ok(stdout, order);
5656
});
5757

5858
test('Using --import to define global hooks works', async (t) => {
5959
const { stdout } = await common.spawnPromisified(process.execPath, [
6060
...testArguments,
61-
'--import', fixtures.fileURL('test-runner', 'no-isolation', 'global-hooks.js'),
61+
'--import', fixtures.fileURL('test-runner', 'no-isolation', 'global-hooks.mjs'),
6262
...testFiles,
6363
]);
6464

65-
t.assert.equal(stdout, order);
65+
t.assert.ok(stdout, order);
6666
});

0 commit comments

Comments
 (0)