Node.js › Core Node.js Modules
What does the node:assert module provide, and how does it differ in purpose from a full testing framework?
IntermediateAnswer
assert provides basic assertion functions that throw an AssertionError when unmet -- a low-level building block used as the assertion layer inside test suites, but it doesn't provide test organization, running, or reporting the way a full framework like Jest does.
assert.strictEqual(2 + 2, 4);
assert.deepStrictEqual({ a: 1 }, { a: 1 });Real-world example A team using node:test pairs it with node:assert for assertions, avoiding an external assertion library for a minimal, dependency-light testing setup.