Skip to content

Commit 5e87609

Browse files
OshriAsulinalexfernandez
authored andcommitted
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: nodejs#49489 Fixes: nodejs#49488 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent d5305bf commit 5e87609

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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)