1

I'm testing my application with mocha along with istanbul. For coverage and testing i'm using the following entries in my package.json

  "test:integration": "cross-env NODE_ENV=test mocha --timeout 20000 src/api/tests/integration",

  "coverage": "nyc report --reporter=text-lcov | coveralls",

The test passes, but when doing yarn coverage i'm getting an error

$ nyc report --reporter=text-lcov | coveralls
[error] "2018-08-04T21:25:57.261Z"  'error from lcovParse: ' 'Failed to parse string'
[error] "2018-08-04T21:25:57.263Z"  'input: ' ''
[error] "2018-08-04T21:25:57.263Z"  'error from convertLcovToCoveralls'

C:\Users\Mikk\Documents\GitHub\backend\node_modules\coveralls\bin\coveralls.js:18
        throw err;
        ^
Failed to parse string

Any ideas? I even tried to reinstall the node modules, but that doesn't seem to fix anything.

Mikk Küttim
  • 13
  • 1
  • 8
  • I've faced a similar problem, hope [this post](https://stackoverflow.com/questions/60362121/how-to-configure-coveralls-with-github-action/65615948#65615948) might help you a little bit. – Zdravko Kolev Jan 07 '21 at 16:12

1 Answers1

1

I had the same set up in my package.json file and the same issues earlier today but I fixed it by refreshing my repo attached to Coveralls.io

After refreshing, I restarted build on Travis CI and it worked.

Ensure you have the following in your project root dir

.coveralls.yml -- It should contain repo_token if you're using a public repo

Samuel Pinheiro
  • 101
  • 1
  • 5