小编Man*_*ani的帖子

纽约报道称 babel mocha 为空

我正在对mocha我的 js 代码进行单元测试,该代码babel也在使用。我用来nyc做报道。但最终的结果却是显示空。

bash 输出

为什么它显示所有文件 0 即使我的测试文件需要redux.jsnumber-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)

javascript mocha.js webpack babeljs nyc

5
推荐指数
0
解决办法
823
查看次数

travis ci无法在Firebase托管上部署

我正在尝试将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)

我不确定是怎么回事。

travis-ci firebase firebase-hosting firebase-cli

0
推荐指数
1
解决办法
568
查看次数