Skip to content

Commit 7557818

Browse files
committed
test: fix test-timeout-flag after revert of auto subtest wait
1 parent 0c3e8dc commit 7557818

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
// Flags: --test-timeout=20
21
'use strict';
3-
const { describe, test } = require('node:test');
2+
const { describe, it } = require('node:test');
43
const { setTimeout } = require('node:timers/promises');
54

65
describe('--test-timeout is set to 20ms', async () => {
7-
await test('should timeout after 20ms', async () => {
8-
await setTimeout(200000, undefined, { ref: false });
6+
it('should timeout after 20ms', async () => {
7+
await setTimeout(2000, undefined);
98
});
10-
await test('should timeout after 5ms', { timeout: 5 }, async () => {
11-
await setTimeout(200000, undefined, { ref: false });
9+
10+
it('should timeout after 5ms', { timeout: 5 }, async () => {
11+
await setTimeout(2000, undefined);
1212
});
1313

14-
await test('should not timeout', { timeout: 50000 }, async () => {
14+
it('should not timeout', { timeout: 50000 }, async () => {
1515
await setTimeout(1);
1616
});
1717

18-
await test('should pass', async () => {});
18+
it('should pass', async () => {});
1919
});

test/parallel/test-runner-output.mjs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,19 @@ const tests = [
134134
},
135135
{
136136
name: 'test-runner/output/test-timeout-flag.js',
137-
flags: ['--test-reporter=tap'],
137+
flags: [
138+
'--test-reporter=tap',
139+
'--test-timeout=20',
140+
],
138141
},
139142
// --test-timeout should work with or without --test flag
140143
{
141144
name: 'test-runner/output/test-timeout-flag.js',
142-
flags: ['--test-reporter=tap', '--test'],
145+
flags: [
146+
'--test-reporter=tap',
147+
'--test-timeout=20',
148+
'--test',
149+
],
143150
},
144151
{
145152
name: 'test-runner/output/hooks-with-no-global-test.js',

0 commit comments

Comments
 (0)