-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving test to another file added timeout to spawn sync
- Loading branch information
1 parent
a0503e8
commit 88f0026
Showing
3 changed files
with
20 additions
and
39 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
require('../common'); | ||
const assert = require('node:assert'); | ||
const { spawnSync } = require('node:child_process'); | ||
const { test } = require('node:test'); | ||
|
||
test('test-timeout flag', () => { | ||
const args = ['--test', '--test-timeout', 10, 'test/fixtures/test-runner/never_ending_sync.js']; | ||
const child = spawnSync(process.execPath, args, { timeout: 100 }); | ||
|
||
assert.strictEqual(child.status, 1); | ||
Check failure on line 11 in test/parallel/test-runner-cli-timeout.js GitHub Actions / test-linux
Check failure on line 11 in test/parallel/test-runner-cli-timeout.js GitHub Actions / test-macOS
Check failure on line 11 in test/parallel/test-runner-cli-timeout.js GitHub Actions / test-asan
|
||
assert.strictEqual(child.signal, null); | ||
assert.strictEqual(child.stderr.toString(), ''); | ||
const stdout = child.stdout.toString(); | ||
assert.match(stdout, /not ok 1 - test/); | ||
assert.match(stdout, / {2}---/); | ||
assert.match(stdout, / {2}duration_ms: .*/); | ||
assert.match(stdout, /failureType: 'testTimeoutFailure/); | ||
assert.match(stdout, /error: 'test timed out after 10ms'/); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters