阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js assert.notEqual

      Node.js assert.notEqual(actual, expected[, message]) 新增于: v0.1.21

      • actual < any>
      • expected < any>
      • message < string> | < Error>

      Strict mode

      An alias of assert.notStrictEqual().

      Legacy mode

      Tests shallow, coercive inequality with the Abstract Equality Comparison ( != ).

      const assert = require('assert');
      
      assert.notEqual(1, 2);
      // OK
      
      assert.notEqual(1, 1);
      // AssertionError: 1 != 1
      
      assert.notEqual(1, '1');
      // AssertionError: 1 != '1'
      

      If the values are equal, an AssertionError is thrown with a message property set equal to the value of the message parameter. If the message parameter is undefined, a default error message is assigned. If the message parameter is an instance of an Error then it will be thrown instead of the AssertionError.


      更多选项请参考:Node.js assert 断言测试,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录