Skip to content

NYC v11.2.0 exclude file with sourcemap from coverage #666

@pvdlg

Description

@pvdlg

Expected Behavior

As previous version, the expected behavior is to include in the coverage all the files in include property whether they have a sourcemap or not.
It seems to be a regression due to #649.

Observed Behavior

When a file referenced in include has a sourcemap it's excluded from the coverage report.

Bonus Points! Code (or Repository) that Reproduces Issue

  • Create src/index.js with some sample code in it
  • Run babel src --source-maps --out-dir lib to create a compiled with a sourcemap in lib
  • Write a test file that import lib/index.js and test it
  • run nyc ava -v

NYC config in package.json:

  "nyc": {
    "lines": 100,
    "statements": 100,
    "functions": 100,
    "branches": 100,
    "include": [
      "lib/*.js"
    ],
    "reporter": [
      "lcov",
      "text"
    ],
    "all": true
  }

NYC will report:
----------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files | Unknown | Unknown | Unknown | Unknown | |
----------|----------|----------|----------|----------|----------------|

Forensic Information

Operating System: OS X
Environment Information: https://gist.github.com/vanduynslagerp/8ff68570c269ed0f11403c77b128ad88

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions