旧版断言模式


旧版断言模式在以下方法中使用 == 运算符

    Legacy assertion mode uses the == operator in:

    To use legacy assertion mode:

    import assert from 'node:assert';const assert = require('node:assert');

    Legacy assertion mode may have surprising results, especially when using assert.deepEqual():

    // WARNING: This does not throw an AssertionError in legacy assertion mode!
    assert.deepEqual(/a/gi, new Date());