Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

At least one file missing from coverage... #980

Closed
AlexisWilke opened this issue Jan 28, 2019 · 15 comments
Closed

At least one file missing from coverage... #980

AlexisWilke opened this issue Jan 28, 2019 · 15 comments

Comments

@AlexisWilke
Copy link

Link to bug demonstration repository.

Right now I don't have a git with my code, it's not quite ready yet...

Expected Behavior

I get all the .js files covered in the output.

Observed Behavior

One of my files is missing in one folder (I did not check each folder... specifically, the file I was most working on disappeared)

Forensic Information

Operating System: Ubuntu 16.04

Non-Working Environment Information:

With the "Working Environment Information" plus the latest babel-plugin-istanbul, is when I started experiencing the issue. The line numbers for errors was fixed, but the otherwise working coverage started seeing files go missing.

This is probably the same problem as experienced by others (see #476 and #686). Removing the babel plugin and all the node_modules, coverage, package-lock.json and reinstalling with npm install fixed the problem. Keeping babel around and it continues to fail.

My .babelrc file:

{
  "env": {
    "test": {
      "plugins": [ "istanbul" ]
    }
  }
}

My extra nyc setup:

  "nyc": {
    "sourceMap": false,
    "instrument": false
   }

That's it. I did not notice right away, but at some point one of the files was out of date. I delete the coverage folder and it did not come back...

Working Environment Information:

With the following I never had any problem.

v10.15.0
6.6.0
rest-architect-server@0.1.0 /home/snapwebsites/private/rest-architect/server
├── js-string-to-object@1.0.0 -> /home/snapwebsites/private/rest-architect/server/lib/js-string-to-object
├─┬ mocha@5.2.0
│ ├── browser-stdout@1.3.1
│ ├── commander@2.15.1
│ ├─┬ debug@3.1.0
│ │ └── ms@2.0.0
│ ├── diff@3.5.0
│ ├── escape-string-regexp@1.0.5
│ ├─┬ glob@7.1.2
│ │ ├── fs.realpath@1.0.0
│ │ ├─┬ inflight@1.0.6
│ │ │ ├── once@1.4.0 deduped
│ │ │ └── wrappy@1.0.2
│ │ ├── inherits@2.0.3
│ │ ├── minimatch@3.0.4 deduped
│ │ ├─┬ once@1.4.0
│ │ │ └── wrappy@1.0.2 deduped
│ │ └── path-is-absolute@1.0.1
│ ├── growl@1.10.5
│ ├── he@1.1.1
│ ├─┬ minimatch@3.0.4
│ │ └─┬ brace-expansion@1.1.11
│ │   ├── balanced-match@1.0.0
│ │   └── concat-map@0.0.1
│ ├─┬ mkdirp@0.5.1
│ │ └── minimist@0.0.8
│ └─┬ supports-color@5.4.0
│   └── has-flag@3.0.0
├─┬ nyc@13.1.0
│ ├── archy@1.0.0
│ ├── arrify@1.0.1
│ ├─┬ caching-transform@2.0.0
│ │ ├── make-dir@1.3.0 deduped
│ │ ├─┬ md5-hex@2.0.0
│ │ │ └── md5-o-matic@0.1.1
│ │ ├─┬ package-hash@2.0.0
│ │ │ ├── graceful-fs@4.1.11
│ │ │ ├── lodash.flattendeep@4.4.0
│ │ │ ├── md5-hex@2.0.0 deduped
│ │ │ └─┬ release-zalgo@1.0.0
│ │ │   └── es6-error@4.1.1
│ │ └─┬ write-file-atomic@2.3.0
│ │   ├── graceful-fs@4.1.11 deduped
│ │   ├── imurmurhash@0.1.4
│ │   └── signal-exit@3.0.2 deduped
│ ├─┬ convert-source-map@1.6.0
│ │ └── safe-buffer@5.1.2
│ ├── debug-log@1.0.1
│ ├─┬ find-cache-dir@2.0.0
│ │ ├── commondir@1.0.1
│ │ ├── make-dir@1.3.0 deduped
│ │ └─┬ pkg-dir@3.0.0
│ │   └── find-up@3.0.0 deduped
│ ├─┬ find-up@3.0.0
│ │ └─┬ locate-path@3.0.0
│ │   ├─┬ p-locate@3.0.0
│ │   │ └─┬ p-limit@2.0.0
│ │   │   └── p-try@2.0.0
│ │   └── path-exists@3.0.0
│ ├─┬ foreground-child@1.5.6
│ │ ├─┬ cross-spawn@4.0.2
│ │ │ ├─┬ lru-cache@4.1.3
│ │ │ │ ├── pseudomap@1.0.2
│ │ │ │ └── yallist@2.1.2
│ │ │ └── which@1.3.1 deduped
│ │ └── signal-exit@3.0.2 deduped
│ ├─┬ glob@7.1.3
│ │ ├── fs.realpath@1.0.0
│ │ ├─┬ inflight@1.0.6
│ │ │ ├── once@1.4.0 deduped
│ │ │ └── wrappy@1.0.2
│ │ ├── inherits@2.0.3
│ │ ├─┬ minimatch@3.0.4
│ │ │ └─┬ brace-expansion@1.1.11
│ │ │   ├── balanced-match@1.0.0
│ │ │   └── concat-map@0.0.1
│ │ ├─┬ once@1.4.0
│ │ │ └── wrappy@1.0.2 deduped
│ │ └── path-is-absolute@1.0.1
│ ├── istanbul-lib-coverage@2.0.1
│ ├─┬ istanbul-lib-hook@2.0.1
│ │ └─┬ append-transform@1.0.0
│ │   └─┬ default-require-extensions@2.0.0
│ │     └── strip-bom@3.0.0
│ ├─┬ istanbul-lib-instrument@3.0.0
│ │ ├─┬ @babel/generator@7.3.0
│ │ │ ├── @babel/types@7.3.0 deduped
│ │ │ ├── jsesc@2.5.2
│ │ │ ├── lodash@4.17.11 deduped
│ │ │ ├── source-map@0.5.7
│ │ │ └── trim-right@1.0.1
│ │ ├── @babel/parser@7.3.1
│ │ ├─┬ @babel/template@7.2.2
│ │ │ ├─┬ @babel/code-frame@7.0.0
│ │ │ │ └─┬ @babel/highlight@7.0.0
│ │ │ │   ├─┬ chalk@2.4.2
│ │ │ │   │ ├─┬ ansi-styles@3.2.1
│ │ │ │   │ │ └─┬ color-convert@1.9.3
│ │ │ │   │ │   └── color-name@1.1.3
│ │ │ │   │ ├── escape-string-regexp@1.0.5 deduped
│ │ │ │   │ └── supports-color@5.4.0 deduped
│ │ │ │   ├── esutils@2.0.2 deduped
│ │ │ │   └── js-tokens@4.0.0
│ │ │ ├── @babel/parser@7.3.1 deduped
│ │ │ └── @babel/types@7.3.0 deduped
│ │ ├─┬ @babel/traverse@7.2.3
│ │ │ ├── @babel/code-frame@7.0.0 deduped
│ │ │ ├── @babel/generator@7.3.0 deduped
│ │ │ ├─┬ @babel/helper-function-name@7.1.0
│ │ │ │ ├─┬ @babel/helper-get-function-arity@7.0.0
│ │ │ │ │ └── @babel/types@7.3.0 deduped
│ │ │ │ ├── @babel/template@7.2.2 deduped
│ │ │ │ └── @babel/types@7.3.0 deduped
│ │ │ ├─┬ @babel/helper-split-export-declaration@7.0.0
│ │ │ │ └── @babel/types@7.3.0 deduped
│ │ │ ├── @babel/parser@7.3.1 deduped
│ │ │ ├── @babel/types@7.3.0 deduped
│ │ │ ├─┬ debug@4.1.1
│ │ │ │ └── ms@2.1.1
│ │ │ ├── globals@11.10.0
│ │ │ └── lodash@4.17.11 deduped
│ │ ├─┬ @babel/types@7.3.0
│ │ │ ├── esutils@2.0.2
│ │ │ ├── lodash@4.17.11 deduped
│ │ │ └── to-fast-properties@2.0.0
│ │ ├── istanbul-lib-coverage@2.0.1
│ │ └── semver@5.6.0
│ ├─┬ istanbul-lib-report@2.0.2
│ │ ├── istanbul-lib-coverage@2.0.1 deduped
│ │ ├── make-dir@1.3.0 deduped
│ │ └─┬ supports-color@5.4.0
│ │   └── has-flag@3.0.0
│ ├─┬ istanbul-lib-source-maps@2.0.1
│ │ ├─┬ debug@3.1.0
│ │ │ └── ms@2.0.0
│ │ ├── istanbul-lib-coverage@2.0.1 deduped
│ │ ├── make-dir@1.3.0 deduped
│ │ ├── rimraf@2.6.2 deduped
│ │ └── source-map@0.6.1
│ ├─┬ istanbul-reports@2.0.1
│ │ └─┬ handlebars@4.0.11
│ │   ├── async@1.5.2
│ │   ├─┬ optimist@0.6.1
│ │   │ ├── minimist@0.0.10
│ │   │ └── wordwrap@0.0.3
│ │   ├─┬ source-map@0.4.4
│ │   │ └── amdefine@1.0.1
│ │   └─┬ uglify-js@2.8.29
│ │     ├── source-map@0.5.7
│ │     ├── uglify-to-browserify@1.0.2
│ │     └─┬ yargs@3.10.0
│ │       ├── camelcase@1.2.1
│ │       ├─┬ cliui@2.1.0
│ │       │ ├─┬ center-align@0.1.3
│ │       │ │ ├─┬ align-text@0.1.4
│ │       │ │ │ ├─┬ kind-of@3.2.2
│ │       │ │ │ │ └── is-buffer@1.1.6
│ │       │ │ │ ├── longest@1.0.1
│ │       │ │ │ └── repeat-string@1.6.1
│ │       │ │ └── lazy-cache@1.0.4
│ │       │ ├─┬ right-align@0.1.3
│ │       │ │ └── align-text@0.1.4 deduped
│ │       │ └── wordwrap@0.0.2
│ │       ├── decamelize@1.2.0 deduped
│ │       └── window-size@0.1.0
│ ├─┬ make-dir@1.3.0
│ │ └── pify@3.0.0
│ ├─┬ merge-source-map@1.1.0
│ │ └── source-map@0.6.1
│ ├── resolve-from@4.0.0
│ ├─┬ rimraf@2.6.2
│ │ └── glob@7.1.3 deduped
│ ├── signal-exit@3.0.2
│ ├─┬ spawn-wrap@1.4.2
│ │ ├── foreground-child@1.5.6 deduped
│ │ ├─┬ mkdirp@0.5.1
│ │ │ └── minimist@0.0.8
│ │ ├── os-homedir@1.0.2
│ │ ├── rimraf@2.6.2 deduped
│ │ ├── signal-exit@3.0.2 deduped
│ │ └─┬ which@1.3.1
│ │   └── isexe@2.0.0
│ ├─┬ test-exclude@5.0.0
│ │ ├── arrify@1.0.1 deduped
│ │ ├── minimatch@3.0.4 deduped
│ │ ├─┬ read-pkg-up@4.0.0
│ │ │ ├── find-up@3.0.0 deduped
│ │ │ └─┬ read-pkg@3.0.0
│ │ │   ├─┬ load-json-file@4.0.0
│ │ │   │ ├── graceful-fs@4.1.11 deduped
│ │ │   │ ├─┬ parse-json@4.0.0
│ │ │   │ │ ├─┬ error-ex@1.3.2
│ │ │   │ │ │ └── is-arrayish@0.2.1
│ │ │   │ │ └── json-parse-better-errors@1.0.2
│ │ │   │ ├── pify@3.0.0 deduped
│ │ │   │ └── strip-bom@3.0.0 deduped
│ │ │   ├─┬ normalize-package-data@2.4.0
│ │ │   │ ├── hosted-git-info@2.7.1
│ │ │   │ ├─┬ is-builtin-module@1.0.0
│ │ │   │ │ └── builtin-modules@1.1.1
│ │ │   │ ├── semver@5.5.0
│ │ │   │ └─┬ validate-npm-package-license@3.0.3
│ │ │   │   ├─┬ spdx-correct@3.0.0
│ │ │   │   │ ├── spdx-expression-parse@3.0.0 deduped
│ │ │   │   │ └── spdx-license-ids@3.0.0
│ │ │   │   └─┬ spdx-expression-parse@3.0.0
│ │ │   │     ├── spdx-exceptions@2.1.0
│ │ │   │     └── spdx-license-ids@3.0.0 deduped
│ │ │   └─┬ path-type@3.0.0
│ │ │     └── pify@3.0.0 deduped
│ │ └── require-main-filename@1.0.1
│ ├── uuid@3.3.2
│ ├─┬ yargs@11.1.0
│ │ ├─┬ cliui@4.1.0
│ │ │ ├── string-width@2.1.1 deduped
│ │ │ ├── strip-ansi@4.0.0 deduped
│ │ │ └─┬ wrap-ansi@2.1.0
│ │ │   ├─┬ string-width@1.0.2
│ │ │   │ ├── code-point-at@1.1.0
│ │ │   │ ├─┬ is-fullwidth-code-point@1.0.0
│ │ │   │ │ └── number-is-nan@1.0.1
│ │ │   │ └── strip-ansi@3.0.1 deduped
│ │ │   └─┬ strip-ansi@3.0.1
│ │ │     └── ansi-regex@2.1.1
│ │ ├── decamelize@1.2.0
│ │ ├─┬ find-up@2.1.0
│ │ │ └─┬ locate-path@2.0.0
│ │ │   ├─┬ p-locate@2.0.0
│ │ │   │ └─┬ p-limit@1.3.0
│ │ │   │   └── p-try@1.0.0
│ │ │   └── path-exists@3.0.0 deduped
│ │ ├── get-caller-file@1.0.3
│ │ ├─┬ os-locale@2.1.0
│ │ │ ├─┬ execa@0.7.0
│ │ │ │ ├─┬ cross-spawn@5.1.0
│ │ │ │ │ ├── lru-cache@4.1.3 deduped
│ │ │ │ │ ├─┬ shebang-command@1.2.0
│ │ │ │ │ │ └── shebang-regex@1.0.0
│ │ │ │ │ └── which@1.3.1 deduped
│ │ │ │ ├── get-stream@3.0.0
│ │ │ │ ├── is-stream@1.1.0
│ │ │ │ ├─┬ npm-run-path@2.0.2
│ │ │ │ │ └── path-key@2.0.1
│ │ │ │ ├── p-finally@1.0.0
│ │ │ │ ├── signal-exit@3.0.2 deduped
│ │ │ │ └── strip-eof@1.0.0
│ │ │ ├─┬ lcid@1.0.0
│ │ │ │ └── invert-kv@1.0.0
│ │ │ └─┬ mem@1.1.0
│ │ │   └── mimic-fn@1.2.0
│ │ ├── require-directory@2.1.1
│ │ ├── require-main-filename@1.0.1 deduped
│ │ ├── set-blocking@2.0.0
│ │ ├─┬ string-width@2.1.1
│ │ │ ├── is-fullwidth-code-point@2.0.0
│ │ │ └─┬ strip-ansi@4.0.0
│ │ │   └── ansi-regex@3.0.0
│ │ ├── which-module@2.0.0
│ │ ├── y18n@3.2.1
│ │ └── yargs-parser@9.0.2 deduped
│ └─┬ yargs-parser@9.0.2
│   └── camelcase@4.1.0
├─┬ request@2.88.0
│ ├── aws-sign2@0.7.0
│ ├── aws4@1.8.0
│ ├── caseless@0.12.0
│ ├─┬ combined-stream@1.0.7
│ │ └── delayed-stream@1.0.0
│ ├── extend@3.0.2
│ ├── forever-agent@0.6.1
│ ├─┬ form-data@2.3.3
│ │ ├── asynckit@0.4.0
│ │ ├── combined-stream@1.0.7 deduped
│ │ └── mime-types@2.1.21 deduped
│ ├─┬ har-validator@5.1.3
│ │ ├─┬ ajv@6.7.0
│ │ │ ├── fast-deep-equal@2.0.1
│ │ │ ├── fast-json-stable-stringify@2.0.0
│ │ │ ├── json-schema-traverse@0.4.1
│ │ │ └─┬ uri-js@4.2.2
│ │ │   └── punycode@2.1.1
│ │ └── har-schema@2.0.0
│ ├─┬ http-signature@1.2.0
│ │ ├── assert-plus@1.0.0
│ │ ├─┬ jsprim@1.4.1
│ │ │ ├── assert-plus@1.0.0 deduped
│ │ │ ├── extsprintf@1.3.0
│ │ │ ├── json-schema@0.2.3
│ │ │ └─┬ verror@1.10.0
│ │ │   ├── assert-plus@1.0.0 deduped
│ │ │   ├── core-util-is@1.0.2
│ │ │   └── extsprintf@1.3.0 deduped
│ │ └─┬ sshpk@1.16.1
│ │   ├─┬ asn1@0.2.4
│ │   │ └── safer-buffer@2.1.2 deduped
│ │   ├── assert-plus@1.0.0 deduped
│ │   ├─┬ bcrypt-pbkdf@1.0.2
│ │   │ └── tweetnacl@0.14.5 deduped
│ │   ├─┬ dashdash@1.14.1
│ │   │ └── assert-plus@1.0.0 deduped
│ │   ├─┬ ecc-jsbn@0.1.2
│ │   │ ├── jsbn@0.1.1 deduped
│ │   │ └── safer-buffer@2.1.2 deduped
│ │   ├─┬ getpass@0.1.7
│ │   │ └── assert-plus@1.0.0 deduped
│ │   ├── jsbn@0.1.1
│ │   ├── safer-buffer@2.1.2
│ │   └── tweetnacl@0.14.5
│ ├── is-typedarray@1.0.0
│ ├── isstream@0.1.2
│ ├── json-stringify-safe@5.0.1
│ ├─┬ mime-types@2.1.21
│ │ └── mime-db@1.37.0
│ ├── oauth-sign@0.9.0
│ ├── performance-now@2.1.0
│ ├── qs@6.5.2
│ ├── safe-buffer@5.1.2
│ ├─┬ tough-cookie@2.4.3
│ │ ├── psl@1.1.31
│ │ └── punycode@1.4.1
│ ├─┬ tunnel-agent@0.6.0
│ │ └── safe-buffer@5.1.2 deduped
│ └── uuid@3.3.2
├─┬ request-promise@4.2.2
│ ├── bluebird@3.5.3
│ ├─┬ request-promise-core@1.1.1
│ │ └── lodash@4.17.11
│ ├── stealthy-require@1.1.1
│ └── tough-cookie@2.4.3 deduped
├─┬ rest-architect@1.0.0 -> /home/snapwebsites/private/rest-architect/server/lib/rest-architect
│ ├─┬ easy-html-email@1.0.0 -> /home/snapwebsites/private/rest-architect/server/lib/easy-html-email
│ │ └── nodemailer@5.1.1
│ ├─┬ http-wrapper@1.0.0 -> /home/snapwebsites/private/rest-architect/server/lib/http-wrapper
│ │ ├── forward-emitter@0.1.1
│ │ └── unfig@1.0.0 -> /home/snapwebsites/private/rest-architect/server/lib/unfig deduped
│ ├─┬ murmurhash3@0.4.2
│ │ └── nan@2.12.1
│ └─┬ persistent-objects@1.0.0 -> /home/snapwebsites/private/rest-architect/server/lib/persistent-objects
│   ├─┬ bcrypt@3.0.3
│   │ ├── nan@2.12.1 deduped
│   │ └─┬ node-pre-gyp@0.12.0
│   │   ├── detect-libc@1.0.3
│   │   ├─┬ mkdirp@0.5.1
│   │   │ └── minimist@0.0.8
│   │   ├─┬ needle@2.2.4
│   │   │ ├─┬ debug@2.6.9
│   │   │ │ └── ms@2.0.0
│   │   │ ├─┬ iconv-lite@0.4.24
│   │   │ │ └── safer-buffer@2.1.2
│   │   │ └── sax@1.2.4
│   │   ├─┬ nopt@4.0.1
│   │   │ ├── abbrev@1.1.1
│   │   │ └─┬ osenv@0.1.5
│   │   │   ├── os-homedir@1.0.2
│   │   │   └── os-tmpdir@1.0.2
│   │   ├─┬ npm-packlist@1.1.12
│   │   │ ├─┬ ignore-walk@3.0.1
│   │   │ │ └─┬ minimatch@3.0.4
│   │   │ │   └─┬ brace-expansion@1.1.11
│   │   │ │     ├── balanced-match@1.0.0
│   │   │ │     └── concat-map@0.0.1
│   │   │ └── npm-bundled@1.0.5
│   │   ├─┬ npmlog@4.1.2
│   │   │ ├─┬ are-we-there-yet@1.1.5
│   │   │ │ ├── delegates@1.0.0
│   │   │ │ └─┬ readable-stream@2.3.5
│   │   │ │   ├── core-util-is@1.0.2
│   │   │ │   ├── inherits@2.0.3 deduped
│   │   │ │   ├── isarray@1.0.0
│   │   │ │   ├── process-nextick-args@2.0.0
│   │   │ │   ├── safe-buffer@5.1.1
│   │   │ │   ├─┬ string_decoder@1.0.3
│   │   │ │   │ └── safe-buffer@5.1.1 deduped
│   │   │ │   └── util-deprecate@1.0.2
│   │   │ ├── console-control-strings@1.1.0
│   │   │ ├─┬ gauge@2.7.4
│   │   │ │ ├── aproba@1.2.0
│   │   │ │ ├── console-control-strings@1.1.0 deduped
│   │   │ │ ├── has-unicode@2.0.1
│   │   │ │ ├── object-assign@4.1.1
│   │   │ │ ├── signal-exit@3.0.2
│   │   │ │ ├─┬ string-width@1.0.2
│   │   │ │ │ ├── code-point-at@1.1.0
│   │   │ │ │ ├─┬ is-fullwidth-code-point@1.0.0
│   │   │ │ │ │ └── number-is-nan@1.0.1
│   │   │ │ │ └── strip-ansi@3.0.1 deduped
│   │   │ │ ├─┬ strip-ansi@3.0.1
│   │   │ │ │ └── ansi-regex@2.1.1
│   │   │ │ └─┬ wide-align@1.1.3
│   │   │ │   └── string-width@1.0.2 deduped
│   │   │ └── set-blocking@2.0.0
│   │   ├─┬ rc@1.2.8
│   │   │ ├── deep-extend@0.6.0
│   │   │ ├── ini@1.3.5
│   │   │ ├── minimist@1.2.0
│   │   │ └── strip-json-comments@2.0.1
│   │   ├─┬ rimraf@2.6.2
│   │   │ └─┬ glob@7.1.2
│   │   │   ├── fs.realpath@1.0.0
│   │   │   ├─┬ inflight@1.0.6
│   │   │   │ ├── once@1.4.0 deduped
│   │   │   │ └── wrappy@1.0.2
│   │   │   ├── inherits@2.0.3
│   │   │   ├── minimatch@3.0.4 deduped
│   │   │   ├─┬ once@1.4.0
│   │   │   │ └── wrappy@1.0.2 deduped
│   │   │   └── path-is-absolute@1.0.1
│   │   ├── semver@5.6.0
│   │   └─┬ tar@4.4.8
│   │     ├── chownr@1.1.1
│   │     ├─┬ fs-minipass@1.2.5
│   │     │ └── minipass@2.3.4 deduped
│   │     ├─┬ minipass@2.3.4
│   │     │ ├── safe-buffer@5.1.2
│   │     │ └── yallist@3.0.2
│   │     ├─┬ minizlib@1.1.1
│   │     │ └── minipass@2.3.4 deduped
│   │     ├── mkdirp@0.5.1 deduped
│   │     ├── safe-buffer@5.1.2
│   │     └── yallist@3.0.2
│   ├── http-wrapper@1.0.0 -> /home/snapwebsites/private/rest-architect/server/lib/http-wrapper deduped
│   ├── mout@1.1.0
│   ├─┬ mysql@2.16.0
│   │ ├── bignumber.js@4.1.0
│   │ ├─┬ readable-stream@2.3.6
│   │ │ ├── core-util-is@1.0.2 deduped
│   │ │ ├── inherits@2.0.3 deduped
│   │ │ ├── isarray@1.0.0
│   │ │ ├── process-nextick-args@2.0.0
│   │ │ ├── safe-buffer@5.1.2 deduped
│   │ │ ├─┬ string_decoder@1.1.1
│   │ │ │ └── safe-buffer@5.1.2 deduped
│   │ │ └── util-deprecate@1.0.2
│   │ ├── safe-buffer@5.1.2 deduped
│   │ └── sqlstring@2.3.1
│   └── uuid@3.3.2 deduped
└─┬ unfig@1.0.0 -> /home/snapwebsites/private/rest-architect/server/lib/unfig
  └─┬ untainted@1.0.0 -> /home/snapwebsites/private/rest-architect/server/lib/untainted
    ├── file-type@10.7.1
    └── validator@10.11.0
@coreyfarrell
Copy link
Member

NYC is a complex system, we need a link to a repo which demonstrates the failure. Please be sure the demo is using the current version of nyc and babel-plugin-istanbul.

@CodisRedding
Copy link

CodisRedding commented Feb 6, 2019

Same issue, but I cannot reproduce in other projects nor post company code to demo. =/

I did have co-workers pull my branch down and confirm that it's an issue on their machines too.

@AlexisWilke
Copy link
Author

@coreyfarrell,

Yeah, I'm sure it's very complex. The principals are easy, but I can imagine how complicated it is to get it right. Anyway, I'm making a note. I'm still in development and the code is not yet publicly available. Once it is so, I'll make sure it still fails and include all the necessary info here.

Thank you.
Alexis

@JaKXz
Copy link
Member

JaKXz commented Feb 6, 2019

@AlexisWilke @CodisRedding we are just looking for a minimal reproduction in public repo. Something that simulates the combination of packages you have and your build system. We don't need your actual projects, but just to troubleshoot your config or your setup or check package versions etc.

@CodisRedding
Copy link

Sorry @JaKXz I moved on to use hapijs/lab. I don't have a way to reproduce this.

@stale
Copy link

stale bot commented Apr 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 15, 2019
@stale stale bot closed this as completed Apr 22, 2019
@vaelinn123
Copy link

vaelinn123 commented Jun 19, 2019

I see this was closed, but wanted to throw some potentially helpful info for others coming to this issue. I had this issue when we upgraded to nyc version 14.1.1 but was able to get full instrumentation back by reverting to using nyc version 13.2.0

@jpadhye
Copy link

jpadhye commented Aug 1, 2019

I faced this same issue. @vaelinn123 your suggestion worked like a charm. Even 13.3.0 is broken. Some change after 13.2.0 is causing this issue.

@coreyfarrell
Copy link
Member

I recommend someone post a new issue including all required information, especially a minimal reproduction in a public repo. Without that we cannot know what the issue is and it will not get fixed. Note 13.x no longer receives any fixes.

@MartinMuzatko
Copy link

No matter which version, the test gets covered but not the file it covers. Only happens with one file. Tried to clear cache

@frankzieglermbc
Copy link

I experienced the same issue. one file would not show up in the coverage report. removing the node_modules folder and package-lock.json file as suggested in related issues did not fix it. I went on and commented all the code in the file that was missing and sure enough it showed up again. after un-commenting code bit by bit, I noticed that one of my function was incorrect.

function myFunction(arg1, arg1, arg2, arg3) {}

after removing the duplicate parameter the file showed up in the coverage report again. so in the end, it was just malformed code. copy-paste error on my side.

not sure if this is related. I just wanted to share how I fixed my issue in case someone else runs into the same problem.

also my dependencies: "aws-sdk-mock": "^5.0.0", "chai": "^4.2.0", "mocha": "^7.0.0", "assert": "^2.0.0", "nyc": "^15.0.0", "sinon": "^8.0.0"

@aaditya
Copy link

aaditya commented Apr 22, 2020

I stumbled across the same problem. Following @frankzieglermbc , I checked my code and sure enough it was because of malformed code. In my case 002 was being passed in an object which is malformed JSON.

@ghost
Copy link

ghost commented Jun 5, 2020

I had the same problem, not showing up a file in test coverage. As @frankzieglermbc said, i checked again the code. The causing problem was naming a variable arguments and passed it to a function call.

@ashwani-pandey
Copy link

I faced this issue too. Turns out nyc ignores files which has issues that, in general, won't throw an error either. In my case, I had two functions with same name in my file. This was by mistake, and shouldn't be there. But since JS doesn't throw error for this, I had no idea till I started to check after nyc coverage was missing for this file.

Good option - Use a default linting guide like the one from Airbnb - https://github.com/airbnb/javascript

@SteffanA
Copy link

Also chiming in because I encountered this issue - for me, one of my express routes contained
const {public} = res.body
converting that to
const pub = res.body['public']
fixed the issue. So in addition to the arguments keyword mentioned above, public also appears to trigger the issue. Hopefully this helps someone else out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests