Skip to content

Commit 048e727

Browse files
committed
test_runner: rename test module to test_runner
This commit renames the new test module to test_runner to avoid conflicting with userland modules or needing a node: scheme on the module.
1 parent 22f2c48 commit 048e727

8 files changed

Lines changed: 9 additions & 20 deletions

File tree

‎doc/api/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* [Report](report.md)
5555
* [Stream](stream.md)
5656
* [String decoder](string_decoder.md)
57-
* [Test runner](test.md)
57+
* [Test runner](test_runner.md)
5858
* [Timers](timers.md)
5959
* [TLS/SSL](tls.md)
6060
* [Trace events](tracing.md)

doc/api/test.md renamed to doc/api/test_runner.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,15 @@
66
77
<!-- source_link=lib/test.js -->
88

9-
The `node:test` module facilitates the creation of JavaScript tests that
9+
The `test_runner` module facilitates the creation of JavaScript tests that
1010
report results in [TAP][] format. To access it:
1111

1212
```mjs
13-
import test from 'node:test';
13+
import test from 'node:test_runner';
1414
```
1515

1616
```cjs
17-
const test = require('node:test');
18-
```
19-
20-
This module is only available under the `node:` scheme. The following will not
21-
work:
22-
23-
```mjs
24-
import test from 'test';
25-
```
26-
27-
```cjs
28-
const test = require('test');
17+
const test = require('node:test_runner');
2918
```
3019

3120
Tests created via the `test` module consist of a single function that is
File renamed without changes.

‎test/message/test_runner_no_refs.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Flags: --no-warnings
22
'use strict';
33
require('../common');
4-
const test = require('node:test');
4+
const test = require('node:test_runner');
55

66
// When run alone, the test below does not keep the event loop alive.
77
test('does not keep event loop alive', async (t) => {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Flags: --no-warnings
22
'use strict';
33
require('../common');
4-
const test = require('node:test');
4+
const test = require('node:test_runner');
55

66
// No TAP output should be generated.
77
console.log(test.name);

‎test/message/test_runner_output.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
'use strict';
33
require('../common');
44
const assert = require('node:assert');
5-
const test = require('node:test');
5+
const test = require('node:test_runner');
66

77
test('sync pass todo', (t) => {
88
t.todo();

‎test/message/test_runner_unresolved_promise.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Flags: --no-warnings
22
'use strict';
33
require('../common');
4-
const test = require('node:test');
4+
const test = require('test_runner');
55

66
test('pass');
77
test('never resolving promise', () => new Promise(() => {}));

‎test/parallel/test-runner-exit-code.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const assert = require('assert');
44
const { spawnSync } = require('child_process');
55

66
if (process.argv[2] === 'child') {
7-
const test = require('node:test');
7+
const test = require('test_runner');
88

99
if (process.argv[3] === 'pass') {
1010
test('passing test', () => {

0 commit comments

Comments
 (0)