question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nyc merge in nyc@next gives 'Invalid file coverage object, missing keys, found:data'

See original GitHub issue

Link to bug demonstration repository

git clone https://github.com/akoidan/vue-webpack-typescript
git checkout multicov
yarn install
yarn test

Expected Behavior

  • tests are merged, no errors

Observed Behavior

commands in example will run multiple test and then tries to run nyc merge that would fail with error: 'Invalid file coverage object, missing keys, found:data' To be specific

yarn run test:unit
yarn nyc merge ./nyc/.nyc_output_unit/ ./nyc/.nyc_output/unit.json 

results a json like this:

{
  "/home/andrew/WebstormProjects/vue-webpack-typescript/src/utils/classComponentHooks.ts": {
    "data": {
      "path": "/home/andrew/WebstormProjects/vue-webpack-typescript/src/utils/classComponentHooks.ts",
      "statementMap": {
        "0": {
          "start": {
            "line": 4,
            "column": 0
          },
          "end": {
            "line": 8,
            "column": 3
          }
        }
      },
      "fnMap": {},
      "branchMap": {},
      "s": {
        "0": 0
      },
      "f": {},
      "b": {},
      "all": true
    }
  }
}

Environment Information

npx: installed 1 in 0.76s

  System:
    OS: Linux 5.3 Arch Linux undefined
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 5.92 GB / 31.25 GB
  Binaries:
    Node: 12.13.0 - /usr/bin/node
    Yarn: 1.19.1 - /usr/bin/yarn
    npm: 6.12.1 - /usr/bin/npm
  npmPackages:
    @babel/plugin-proposal-class-properties: 7.7.0 => 7.7.0 
    @babel/plugin-proposal-decorators: 7.7.0 => 7.7.0 
    @babel/preset-env: 7.7.1 => 7.7.1 
    babel-loader: 8.0.6 => 8.0.6 
    babel-plugin-istanbul: 5.2.0 => 5.2.0 
    babel-preset-typescript-vue: 1.0.2 => 1.0.2 
    istanbul-lib-coverage: 2.0.5 => 2.0.5 
    nyc: ^15.0.0-beta.0 => 15.0.0-beta.0 
    source-map-support: 0.5.16 => 0.5.16 
    ts-node: 8.5.2 => 8.5.2 
    typescript: 3.7.2 => 3.7.2 

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Maximus1285commented, Oct 27, 2020

I’m running into this issue as well.

1reaction
coreyfarrellcommented, Nov 26, 2019

@akoidan I’m very busy so I have to ask for your patience.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving “Invalid file coverage object, missing keys, found ...
Resolving “Invalid file coverage object, missing keys, found:data” for NYC. If you are merging two NYC coverage reports, for example your Cypress and...
Read more >
nyc merge in nyc@next gives 'Invalid file coverage object ...
nyc merge in nyc@next gives 'Invalid file coverage object, missing keys, found:data'
Read more >
Invalid file coverage object, missing keys, found:data
Invalid file coverage object, missing keys, found:data ... has an unnecessary data property for some files, which is breaking merge.
Read more >
node-npmtest-nyc/nyc/node_modules/istanbul-lib-coverage/lib
... if (!valid) { throw new Error('Invalid file coverage object, missing keys, found:' + Object.keys(obj).join(',')); } } /** * provides a ...
Read more >
NYCNext - Rebuild the Next New York City
New Yorkers on a mission to support and rebuild New York City.Here's a chance to share your love and energy to rebuild the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found