Skip to content

Commit c61f363

Browse files
bmecktargos
authored andcommitted
doc: internal/test/binding for testing
PR-URL: #38026 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 0bb6fe3 commit c61f363

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/guides/writing-tests.md

+9
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,15 @@ const assert = require('assert');
287287
const freelist = require('internal/freelist');
288288
```
289289

290+
In specific scenarios it may be useful to get a hold of `primordials` or
291+
`internalBinding()`. You can do so using
292+
293+
```console
294+
node --expose-internals -r internal/test/binding lib/fs.js
295+
```
296+
297+
This only works if you preload `internal/test/binding` by command line flag.
298+
290299
### Assertions
291300

292301
When writing assertions, prefer the strict versions:

0 commit comments

Comments
 (0)