mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
Signed-off-by: Moshe Atlow <moshe@atlow.co.il> PR-URL: https://github.com/nodejs/node/pull/62502 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
18 lines
436 B
JavaScript
18 lines
436 B
JavaScript
'use strict';
|
|
const dc = require('node:diagnostics_channel');
|
|
const { test } = require('node:test');
|
|
|
|
const events = [];
|
|
dc.subscribe('tracing:node.test:error', (data) => {
|
|
events.push(data.name);
|
|
});
|
|
|
|
test('test that intentionally fails', async () => {
|
|
throw new Error('expected failure for error event testing');
|
|
});
|
|
|
|
// Report events on exit
|
|
process.on('exit', () => {
|
|
console.log(JSON.stringify({ errorEvents: events }));
|
|
});
|