Skip to content
Prev Previous commit
Next Next commit
fixup! change timeout to 20ms and format the file
  • Loading branch information
jakecastelli committed Mar 29, 2025
commit c1f556200038c0834061d5a1433886163d8bcbe3
8 changes: 4 additions & 4 deletions test/fixtures/test-runner/output/test-timeout-flag.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Flags: --test-timeout=500
// Flags: --test-timeout=20
'use strict';
const { describe, test } = require('node:test');
const { setTimeout } = require('node:timers/promises');

describe('--test-timeout is set to 500ms', () => {
test('test 1 must fail due to testTimeoutFailure with error test timed out after 500ms', async () => {
describe('--test-timeout is set to 20ms', () => {
Comment thread
jakecastelli marked this conversation as resolved.
Resolved
test('test 1 must fail due to testTimeoutFailure with error test timed out after 20ms', async () => {
await setTimeout(1000);
})
test('test 2 must fail due to testTimeoutFailure with error test timed out after 600ms', { timeout: 600 }, async () => {
Expand All @@ -13,4 +13,4 @@ describe('--test-timeout is set to 500ms', () => {
test('test 3 must pass', async () => {
await setTimeout(10);
})
});
});
10 changes: 5 additions & 5 deletions test/fixtures/test-runner/output/test-timeout-flag.snapshot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
TAP version 13
# Subtest: --test-timeout is set to 500ms
# Subtest: test 1 must fail due to testTimeoutFailure with error test timed out after 500ms
not ok 1 - test 1 must fail due to testTimeoutFailure with error test timed out after 500ms
# Subtest: --test-timeout is set to 20ms
# Subtest: test 1 must fail due to testTimeoutFailure with error test timed out after 20ms
not ok 1 - test 1 must fail due to testTimeoutFailure with error test timed out after 20ms
---
duration_ms: *
type: 'test'
location: '/test/fixtures/test-runner/output/test-timeout-flag.js:(LINE):3'
failureType: 'testTimeoutFailure'
error: 'test timed out after 500ms'
error: 'test timed out after 20ms'
code: 'ERR_TEST_FAILURE'
stack: |-
async Promise.all (index 0)
Expand All @@ -29,7 +29,7 @@ TAP version 13
type: 'test'
...
1..3
not ok 1 - --test-timeout is set to 500ms
not ok 1 - --test-timeout is set to 20ms
---
duration_ms: *
type: 'suite'
Expand Down