node:assert/strict
The strict version of Node.js's built-in assertion module, where comparisons such as equal and deepEqual never convert types.
In more detail
In legacy node:assert, equal(1, "1") passes because it uses ==; in strict mode it fails. assert.rejects() awaits a promise and checks that it rejects with the expected error.
Related terms
- assertion — A check that a condition is true, which stops a test or program with a failure if it is false.
- test runner — A tool that finds test files, runs the tests in them and reports which passed and which failed.
Taught in
- Native Test Runner: node:test & node:assert/strict — Node.js Internals & Backend Services