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

Taught in

References