严格断言模式


🌐 Strict assertion mode

在严格断言模式下,非严格方法的行为就像它们对应的严格方法。例如,assert.deepEqual() 的行为将像 assert.deepStrictEqual() 一样。

🌐 In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example, assert.deepEqual() will behave like assert.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.