assert.ok() 的别名。

const assert = require('assert');

assert(true);  // OK
assert(1);     // OK
assert(false);
  // throws "AssertionError: false == true"
assert(0);
  // throws "AssertionError: 0 == true"
assert(false, 'it\'s false');
  // throws "AssertionError: it's false"

相关文章:

  • 2022-12-23
  • 2021-12-02
  • 2021-12-13
  • 2021-12-13
  • 2021-10-20
  • 2022-12-23
猜你喜欢
  • 2021-12-13
  • 2022-01-22
  • 2022-12-23
  • 2021-08-13
相关资源
相似解决方案