Skip to content

Commit

Permalink
doc: internal/test/binding for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeck committed Apr 2, 2021
1 parent 3ef9562 commit 2facf36
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/guides/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,15 @@ const assert = require('assert');
const freelist = require('internal/freelist');
```

In specific scenarios it may be useful to get a hold of `primordials` or
`internalBinding()`. You can do so using

```console
node --expose-internals -r internal/test/binding lib/fs.js
```

This only works if you preload `internal/test/binding` by command line flag.

### Assertions

When writing assertions, prefer the strict versions:
Expand Down

0 comments on commit 2facf36

Please sign in to comment.