At least one file missing from coverage...
See original GitHub issueLink 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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:15 (3 by maintainers)

Top Related StackOverflow Question
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β
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