|
1 | | -// Flags: --test-timeout=20 |
2 | 1 | 'use strict'; |
3 | | -const { describe, test } = require('node:test'); |
| 2 | +const { describe, it } = require('node:test'); |
4 | 3 | const { setTimeout } = require('node:timers/promises'); |
5 | 4 |
|
6 | 5 | 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); |
9 | 8 | }); |
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); |
12 | 12 | }); |
13 | 13 |
|
14 | | - await test('should not timeout', { timeout: 50000 }, async () => { |
| 14 | + it('should not timeout', { timeout: 50000 }, async () => { |
15 | 15 | await setTimeout(1); |
16 | 16 | }); |
17 | 17 |
|
18 | | - await test('should pass', async () => {}); |
| 18 | + it('should pass', async () => {}); |
19 | 19 | }); |
0 commit comments