cypress-io / cypress-io/code-coverage

Import Statement of module doesn't include it in code coverage.

Open
#313 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
445
Forks
115
PR merge metrics
No merged PRs in 30d

Description

**Logs and screenshots**
Please provide debug logs by running Cypress from the terminal with `DEBUG=code-coverage` environment variable set, see the [Debugging](https://github.com/cypress-io/code-coverage#debugging) section of the README file.

**Versions**

- What is this plugin's version? If this is NOT the latest [released version](https://github.com/cypress-io/code-coverage/releases) can you try the latest version, please?
3.8.1

- If the plugin worked before in version X, but stopped after upgrading to version Y, please try the [released versions](https://github.com/cypress-io/code-coverage/releases) between X and Y to see where the breaking change was.
I have directly started using this version

- What is Cypress version?
5.2.0

- What is your operating system?
MacOs Sierra 10.12.6

- What is the shell?

- What is the Node version?
v10.16.0

- What is the NPM version?
6.9.0

- How do you instrument your application? Cypress [does not instrument web application code](https://github.com/cypress-io/code-coverage#instrument-your-application), so you need to do it yourself.

- When running tests, if you open the web application in regular browser, and open DevTools, do you see `window.__coverage__` object? Can you paste a screenshot?
istanbul-instrumenter-loader
@istanbuljs/nyc-config-typescript
![Screen Shot 2020-09-29 at 8 52 52 AM](https://user-images.githubusercontent.com/11378081/94509159-45a49880-0231-11eb-9287-806095abdf9e.png)

@briebug/cypress-schematic:cypress

- Is there `.nyc_output` folder? Is there `.nyc_output/out.json` file. Is it empty? Can you paste at least part of it so we can see the keys and file paths?
yes, there is a folder.
No, it's not empty

- Do you have any custom NYC settings in `package.json` (`nyc` object) or in other [NYC config files](https://github.com/istanbuljs/nyc#configuration-files)
"nyc": {
"extends": "@istanbuljs/nyc-config-typescript",
"all": true
},

- Do you run Cypress tests in a Docker container?
no

**Describe the bug**
A clear and concise description of what the bug is.
I have imported the lazy loaded modules of my angular application in the spec.ts file but they are not being considered in code coverage. Only files called from the browser are being considered in code coverage.

**Link to the repo**
Bugs with a reproducible example, like an open source repo showing the bug, are the most likely to be resolved.

**Example**
See [#217](https://github.com/cypress-io/code-coverage/issues/217) that is an excellent bug report example

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.