Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CR
  • Loading branch information
MoLow committed Jul 25, 2022
commit 6e61b027c802582c8275c8afd4153732d9e33985
4 changes: 1 addition & 3 deletions test/fixtures/test-runner/never_ending_async.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const test = require('node:test');
const { setTimeout } = require('timers/promises');

test('never ending test', () => {
return setTimeout(100_000_000);
});
test('never ending test', () => setTimeout(100_000_000));
Comment thread
benjamingr marked this conversation as resolved.
Outdated
Comment thread
MoLow marked this conversation as resolved.
Outdated
4 changes: 1 addition & 3 deletions test/fixtures/test-runner/never_ending_sync.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const test = require('node:test');

test('never ending test', () => {
while (true) {

}
while (true);
});
Comment thread
MoLow marked this conversation as resolved.
Outdated
25 changes: 8 additions & 17 deletions test/parallel/test-runner-exit-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ async function runAndKill(file) {
const { 0: { 0: code, 1: signal } } = await Promise.all([once(child, 'exit'), finished(child.stdout)]);
Comment thread
aduh95 marked this conversation as resolved.
Outdated
assert.strictEqual(code, 1);
assert.strictEqual(signal, null);
return stdout;
if (common.isWindows) {
common.printSkipMessage('signals are not supported in windows');
} else {
assert.match(stdout, /not ok 1/);
assert.match(stdout, /# cancelled 1\n/);
}
}

if (process.argv[2] === 'child') {
Expand Down Expand Up @@ -46,20 +51,6 @@ if (process.argv[2] === 'child') {
assert.strictEqual(child.status, 1);
assert.strictEqual(child.signal, null);

runAndKill(fixtures.path('test-runner', 'never_ending_sync.js')).then(common.mustCall(async (stdout) => {
if (common.isWindows) {
common.printSkipMessage('signals are not supported in windows');
} else {
assert.match(stdout, /not ok 1/);
assert.match(stdout, /# cancelled 1\n/);
}
}));
runAndKill(fixtures.path('test-runner', 'never_ending_async.js')).then(common.mustCall(async (stdout) => {
if (common.isWindows) {
common.printSkipMessage('signals are not supported in windows');
} else {
assert.match(stdout, /not ok 1/);
assert.match(stdout, /# cancelled 1\n/);
}
}));
runAndKill(fixtures.path('test-runner', 'never_ending_sync.js')).then(common.mustCall());
runAndKill(fixtures.path('test-runner', 'never_ending_async.js')).then(common.mustCall());
}