Skip to content

Commit 6919d72

Browse files
authored
doc: fix missing imports in test.run code examples
The script was missing necessary imports for the `run` function and the `path` module, causing it to fail. This commit adds the missing imports and resolves the issue. - Import `run` from the appropriate module. - Import `path` to resolve file paths. The script should now run without errors. PR-URL: #49489 Fixes: #49488 Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent fdc65d9 commit 6919d72

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/test.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,9 @@ changes:
908908

909909
```mjs
910910
import { tap } from 'node:test/reporters';
911+
import { run } from 'node:test';
911912
import process from 'node:process';
913+
import path from 'node:path';
912914

913915
run({ files: [path.resolve('./tests/test.js')] })
914916
.compose(tap)
@@ -917,6 +919,8 @@ run({ files: [path.resolve('./tests/test.js')] })
917919

918920
```cjs
919921
const { tap } = require('node:test/reporters');
922+
const { run } = require('node:test');
923+
const path = require('node:path');
920924

921925
run({ files: [path.resolve('./tests/test.js')] })
922926
.compose(tap)

0 commit comments

Comments
 (0)