xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

js coverage testing

js coverage testing

测试覆盖率

istanbul 伊斯坦堡/伊斯坦布尔

https://istanbul.js.org/

jest coverage

https://jestjs.io/img/content/feature-coverage.png

单元测试

集成测试

jest test

jest

https://jestjs.io/docs/zh-Hans/getting-started.html

$ yarn add -D jest
# OR
$ npm i -D jest

# test
$ yarn test

$ npm test
# $ npm run test

Jest CLI

https://jestjs.io/docs/zh-Hans/cli

$ yarn global add jest
# OR
$ npm i -g jest

# find-the-symmetric-difference.js
# find-the-symmetric-difference.test.js
$ jest find-the-symmetric-difference --notify --config=config.json

$ jest find-the-symmetric-difference --notify --config=config.json
# ❌ bug
# Error: Can't find a root directory while resolving a config file path.
# Provided path to resolve: config.json

$ jest find-the-symmetric-difference --notify
# $ jest ./find-the-symmetric-difference --notify

refs



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2020-08-28 14:17  xgqfrms  阅读(360)  评论(3编辑  收藏  举报