【文件属性】:
文件名称:browser-assert:轻量级断言模块
文件大小:12KB
文件格式:ZIP
更新时间:2021-05-14 07:35:10
JavaScript
目录
断言
Stability: stable 。
用于浏览器和旨在与一起使用的Featherwight assert功能。
function assert ( expr , message ) {
if ( ! Boolean ( expr ) ) {
throw new Error ( message || 'unknown assertion error' ) ;
}
}
安装
npm i browser-assert --save
开发者
开发人员工作流程是通过gulp进行的,但应作为npm脚本执行,以在必要时启用Shell执行。
测试
使用phantomjs运行无头测试套件:
npm test
要在浏览器上下文中运行测试,请打开test / index.html或使用服务器npm start 。
开始
使用以下命令从Web服务器提供测试文件:
n
【文件预览】:
browser-assert-master
----package.json(2KB)
----test()
--------index.html(764B)
--------spec()
----gulpfile.js(55B)
----gulp()
--------config.js(1KB)
--------tasks()
--------bundle.js(946B)
----LICENSE(1KB)
----.npmignore(123B)
----doc()
--------readme()
----.gitignore(102B)
----lib()
--------assert.js(147B)
----README.md(2KB)