From 2facf3679dcfd07a5ade17e23fc3e7a795cca6b3 Mon Sep 17 00:00:00 2001 From: Bradley Farias Date: Fri, 2 Apr 2021 14:26:01 -0500 Subject: [PATCH] doc: internal/test/binding for testing --- doc/guides/writing-tests.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md index 1a23d8f2a4a0ca..8424f744d16927 100644 --- a/doc/guides/writing-tests.md +++ b/doc/guides/writing-tests.md @@ -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: