我正在对mocha
我的 js 代码进行单元测试,该代码babel
也在使用。我用来nyc
做报道。但最终的结果却是显示空。
为什么它显示所有文件 0 即使我的测试文件需要redux.js
和number-reducer.js
文件?
我的 package.json 中的测试脚本是
{
...
"scripts": {
...
"test": "cross-env NODE_ENV=test npm run lint && nyc --reporter=lcov --reporter=text mocha",
"coverage": "nyc report --reporter=text-lcov | coveralls"
},
...
"devDependencies": {
"@babel/core": "~7.3.4",
"@babel/preset-env": "~7.3.4",
"@babel/register": "~7.0.0",
"babel-loader": "~8.0.5",
"babel-plugin-istanbul": "~5.1.1",
"babel-polyfill": "~6.26.0",
"chai": "~4.2.0",
...
"cross-env": "~5.2.0",
"eslint": "~5.15.0",
"mocha": "~6.0.0",
"nyc": "~13.3.0",
...
"webpack": "~4.29.4",
"webpack-cli": "~3.2.1"
},
"nyc": {
"require": [
"@babel/register"
], …
Run Code Online (Sandbox Code Playgroud) 我正在尝试将travis ci集成到我的firebase应用程序上以自动部署,但是失败并显示401错误。这是我的.travis.yml
language: node_js
node_js:
- '8'
deploy:
provider: firebase
token:
secure: "BnzKtrzBaI/uLHoezYpBVqQ/VwhIyil...n0jAuBNrTI="
message: build $TRAVIS_BUILD_NUMBER $TRAVIS_BRANCH/$COMMIT_HASH
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Error: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
Run Code Online (Sandbox Code Playgroud)
我不确定是怎么回事。
babeljs ×1
firebase ×1
firebase-cli ×1
javascript ×1
mocha.js ×1
nyc ×1
travis-ci ×1
webpack ×1