File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
fixtures/test-runner/output Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 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' , ( ) => {
7
- test ( 'should timeout after 20ms' , async ( ) => {
8
- await setTimeout ( 200000 , undefined , { ref : false } ) ;
6
+ it ( 'should timeout after 20ms' , async ( ) => {
7
+ await setTimeout ( 2000 ) ;
9
8
} ) ;
10
- 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 ) ;
12
12
} ) ;
13
13
14
- 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
- test ( 'should pass' , async ( ) => { } ) ;
18
+ it ( 'should pass' , async ( ) => { } ) ;
19
19
} ) ;
Original file line number Diff line number Diff line change @@ -134,12 +134,19 @@ const tests = [
134
134
} ,
135
135
{
136
136
name : 'test-runner/output/test-timeout-flag.js' ,
137
- flags : [ '--test-reporter=tap' ] ,
137
+ flags : [
138
+ '--test-reporter=tap' ,
139
+ '--test-timeout=20' ,
140
+ ] ,
138
141
} ,
139
142
// --test-timeout should work with or without --test flag
140
143
{
141
144
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
+ ] ,
143
150
} ,
144
151
{
145
152
name : 'test-runner/output/hooks-with-no-global-test.js' ,
You can’t perform that action at this time.
0 commit comments