From f52c92134c28ff5758d1bda41efb826169daa5ad 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 PR-URL: https://github.com/nodejs/node/pull/38026 Reviewed-By: James M Snell Reviewed-By: Antoine du Hamel Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig --- 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: