Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 10 additions & 0 deletions test/fixtures/event_loop/max_tick_depth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';
require('../../common');

process.maxTickDepth = 10;
let i = 20;
process.nextTick(function f() {
console.error(`tick ${i}`);
if (i-- > 0)
process.nextTick(f);
});
13 changes: 13 additions & 0 deletions test/fixtures/event_loop/nexttick_throw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';
require('../../common');

process.nextTick(function() {
process.nextTick(function() {
process.nextTick(function() {
process.nextTick(function() {
// eslint-disable-next-line no-undef,no-unused-expressions
undefined_reference_error_maker;
});
});
});
});
9 changes: 9 additions & 0 deletions test/fixtures/event_loop/nexttick_throw.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<project-root>/test/fixtures/event_loop/nexttick_throw.js:7
undefined_reference_error_maker;
^

ReferenceError: undefined_reference_error_maker is not defined
at <project-root>/test/fixtures/event_loop/nexttick_throw.js:7:3
at <node-internal-frames>

Node.js <node-version>
31 changes: 0 additions & 31 deletions test/message/max_tick_depth.js

This file was deleted.

34 changes: 0 additions & 34 deletions test/message/nexttick_throw.js

This file was deleted.

9 changes: 0 additions & 9 deletions test/message/nexttick_throw.out

This file was deleted.

19 changes: 19 additions & 0 deletions test/parallel/test-node-output-event-loop.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import * as snapshot from '../common/assertSnapshot.js';
import { describe, it } from 'node:test';

describe('event_loop output', { concurrency: !process.env.TEST_PARALLEL }, () => {
const tests = [
{ name: 'event_loop/max_tick_depth.js' },
{ name: 'event_loop/nexttick_throw.js' },
];
for (const { name } of tests) {
it(name, async () => {
await snapshot.spawnAndAssert(
fixtures.path(name),
snapshot.defaultTransform,
);
});
}
});
Loading