DEV Community

Discussion on: How to set up Cypress code coverage with TypeScript and ts-loader

Collapse
 
inspiraller profile image
steve • Edited

Hi thanks for sharing this. I cloned your repo and was struggling to see the results of the coverage, after following all your instructions:

Cannot find coverage file c:\cypress-typescript-coverage-example\.nyc_output\out.json
Skipping coverage report
Enter fullscreen mode Exit fullscreen mode

I realised now that when running the actual application in dev mode, that is when the plugins are detected in babel. This is my update. Might be worth

Add dependency - cross-env - or something to enable the variable

yarn add cross-env --save-dev
Enter fullscreen mode Exit fullscreen mode

package.json

  "scripts": {
    "start": "cross-env CODE_COVERAGE=true webpack-dev-server",
    "test": "nyc --reporter=text-summary cypress run --headless"
  }
Enter fullscreen mode Exit fullscreen mode