@cypress/code-coverage
Advanced tools
Comparing version 3.2.2 to 3.2.3
{ | ||
"name": "@cypress/code-coverage", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "Saves the code coverage collected during Cypress tests", | ||
@@ -57,3 +57,2 @@ "main": "index.js", | ||
"@babel/core": "7.9.0", | ||
"@istanbuljs/nyc-config-typescript": "1.0.1", | ||
"babel-plugin-istanbul": "6.0.0", | ||
@@ -69,3 +68,2 @@ "check-code-coverage": "1.0.1", | ||
"serve": "11.3.0", | ||
"source-map-support": "0.5.16", | ||
"start-server-and-test": "1.10.11", | ||
@@ -72,0 +70,0 @@ "typescript": "3.8.3" |
@@ -232,23 +232,6 @@ # @cypress/code-coverage [![renovate-app badge][renovate-badge]][renovate-app] [![CircleCI](https://circleci.com/gh/cypress-io/code-coverage.svg?style=svg)](https://circleci.com/gh/cypress-io/code-coverage) | ||
TypeScript source files are NOT included in the code coverage report by default, even if they are properly instrumented. In order to tell `nyc` to include TS files in the report, you need to: | ||
TypeScript source files should be automatically included in the report, if they are instrumented. | ||
1. Add these dev dependencies that let Istanbul work with TypeScript | ||
See [examples/ts-example](examples/ts-example) and [bahmutov/cra-ts-code-coverage-example](https://github.com/bahmutov/cra-ts-code-coverage-example). | ||
```shell | ||
npm i -D @istanbuljs/nyc-config-typescript source-map-support | ||
``` | ||
2. In `package.json` use the following `nyc` configuration object | ||
```json | ||
{ | ||
"nyc": { | ||
"extends": "@istanbuljs/nyc-config-typescript", | ||
"all": true | ||
} | ||
} | ||
``` | ||
See [examples/ts-example](examples/ts-example) | ||
## Exclude code | ||
@@ -417,2 +400,4 @@ | ||
**Tip:** use [check-code-coverage](https://github.com/bahmutov/check-code-coverage) for stricter code coverage checks than `nyc report --check-coverage` allows. | ||
### Markdown | ||
@@ -419,0 +404,0 @@ |
10
task.js
@@ -151,2 +151,3 @@ // @ts-check | ||
// for now let's just camel case all options | ||
// https://github.com/istanbuljs/nyc#common-configuration-options | ||
const nycReportOptions = { | ||
@@ -160,3 +161,10 @@ reportDir, | ||
excludeAfterRemap: true, | ||
extension: ['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx'], | ||
extension: nycOptions.extension || [ | ||
'.js', | ||
'.cjs', | ||
'.mjs', | ||
'.ts', | ||
'.tsx', | ||
'.jsx' | ||
], | ||
all: nycOptions.all | ||
@@ -163,0 +171,0 @@ } |
13
492
38365
415