In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example,
deepEqual will behave like deepStrictEqual.
In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error
messages for objects display the objects, often truncated.
To deactivate the colors, use the NO_COLOR or NODE_DISABLE_COLORS environment variables. This will also
deactivate the colors in the REPL. For more on color support in terminal environments, read the tty
getColorDepth() documentation.
In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example, deepEqual will behave like deepStrictEqual.
In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error messages for objects display the objects, often truncated.
To use strict assertion mode:
Example error diff:
To deactivate the colors, use the
NO_COLOR
orNODE_DISABLE_COLORS
environment variables. This will also deactivate the colors in the REPL. For more on color support in terminal environments, read the ttygetColorDepth()
documentation.Since
v15.0.0, v13.9.0, v12.16.2, v9.9.0