Skip to content

Commit f52c921

Browse files
bmeckTrott
authored andcommitted
doc: internal/test/binding for testing
PR-URL: #38026 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent ab42ef3 commit f52c921

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
@@ -286,6 +286,15 @@ const assert = require('assert');
286286
const freelist = require('internal/freelist');
287287
```
288288

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

291300
When writing assertions, prefer the strict versions:

0 commit comments

Comments
 (0)