mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
432d1b50e0
This commit adds a new 'test' module that exposes an API for creating JavaScript tests. As the tests execute, TAP output is written to standard output. This commit only supports executing individual test files, and does not implement command line functionality for a full test runner. PR-URL: https://github.com/nodejs/node/pull/42325 Refs: https://github.com/nodejs/node/issues/40954 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
14 lines
382 B
JavaScript
14 lines
382 B
JavaScript
// Flags: --no-warnings
|
|
'use strict';
|
|
require('../common');
|
|
const test = require('node:test');
|
|
|
|
// When run alone, the test below does not keep the event loop alive.
|
|
test('does not keep event loop alive', async (t) => {
|
|
await t.test('+does not keep event loop alive', async (t) => {
|
|
return new Promise((resolve) => {
|
|
setTimeout(resolve, 1000).unref();
|
|
});
|
|
});
|
|
});
|