Assertrue
extends assert of node 扩展node原生的Assert功能
Usage 用法
Usage for English is Coming soon...
Start 开始使用
1. 引入
使用nodejs
$ npm install --save assertrue
const assert = ;
- 说明:assertrue中已经包含原生assert的全部功能,不需要再额外引入assert
扩展功能
isTrue(actual, [message])
1. assert; //okassert; //okassert; //okassert; //AssertionErrorassert; //AssertionErrorassert; //AssertionError
isStrictTrue(actual, [message])
2. assert; //okassert; //AssertionErrorassert; //AssertionErrorassert; //AssertionErrorassert; //AssertionErrorassert; //AssertionError
isFalse(actual, [message])
3. isStrictFalse(actual, [message])
4. isNaN(actual, [message])
5. assert; //okassert; //okassert; //okassert; //AssertionErrorassert; //AssertionErrorassert; //AssertionError
isStrictNaN(actual, [message])
6. assert; //okassert; //AssertionErrorassert; //AssertionErrorassert; //AssertionErrorassert; //AssertionErrorassert; //AssertionError
isNotNaN(actual, [message])
7. isNotStrictNaN(actual, [message])
8. isStrictString(actual, [message])
9. assert; //ok
isNotStrictString(actual, [message])
10. isStrictArray(actual, [message])
11. assert; //ok
isNotStrictArray(actual, [message])
12. isStrictFunction(actual, [message])
13. assert; //ok
isNotStrictFunction(actual, [message])
14. isStrictRegExp(actual, [message])
15. assert; //ok
isNotStrictRegExp(actual, [message])
16. isStrictBoolean(actual, [message])
17. assert; //ok
isNotStrictBoolean(actual, [message])
18. isStrictNumber(actual, [message])
19. assert; //ok
isNotStrictNumber(actual, [message])
20. is(actual, expectedType, [message])
21. assert; //okassert; //ok {} {} assert; //okassert; //okassert; //okassert; //AssertionErrorassert; //AssertionError
isNot(actual, expectedType, [message])
22. isAssignableFrom(superType, subType, [message])
23. {} {} assert; //okassert; //okassert; //okassert; //AssertionError
isNotAssignableFrom(superType, subType, [message])
24. isAssignableTo(subType, superType, [message])
25 {} {} assert; //okassert; //okassert; //okassert; //AssertionError
isNotAssignableTo(subType, superType, [message])
26 Change list 更新日志
2020-05-12 v1.0.5
增加对class继承关系的断言
2017-03-22 v1.0.4
重命名为assertrue
2017-03-17 v1.0.3
增加 Travis CI 支持
新增对各种类型的断言
v1.0.2
正式启动项目
More docs and examples, to be continue... 更多接口文档的案例,未完待补充...