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

Simple ES5 test file fails at coverage #1214

Closed
vvo opened this issue Jun 28, 2016 · 8 comments
Closed

Simple ES5 test file fails at coverage #1214

vvo opened this issue Jun 28, 2016 · 8 comments

Comments

@vvo
Copy link
Contributor

vvo commented Jun 28, 2016

I am tryiing to user jest --coverage without luck, I somehow endup with weird coverage report.

I have setup a reproducible repository at https://github.com/vvo/test-coverage-jest.

index.js:

module.exports = function index(opts, cb) {
  cb(opts);
}

test.js

var index = require('../index.js');

describe('test', function() {
  it('works', function() {
    index({test: 'lol'}, function(){});
  });
});

result

> test-coverage-jest@1.0.0 test:jest /home/vvo/Dev/Algolia/test-coverage
> jest --no-cache --coverage

Using Jest CLI v13.0.0, jasmine2
 PASS  __tests__/index.js (0.085s)
1 test passed (1 total in 1 test suite, run time 0.541s)
----------------|----------|----------|----------|----------|----------------|
File            |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------------|----------|----------|----------|----------|----------------|
 test-coverage/ |       50 |      100 |        0 |       50 |                |
  index.js      |       50 |      100 |        0 |       50 |              2 |
----------------|----------|----------|----------|----------|----------------|
All files       |       50 |      100 |        0 |       50 |                |
----------------|----------|----------|----------|----------|----------------|

Same with mocha:

> test-coverage-jest@1.0.0 test:mocha /home/vvo/Dev/Algolia/test-coverage
> NODE_ENV=test nyc mocha --compilers js:babel-register



  test
    ✓ works


  1 passing (299ms)

----------------|----------|----------|----------|----------|----------------|
File            |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------------|----------|----------|----------|----------|----------------|
 test-coverage/ |      100 |      100 |      100 |      100 |                |
  index.js      |      100 |      100 |      100 |      100 |                |
----------------|----------|----------|----------|----------|----------------|
All files       |      100 |      100 |      100 |      100 |                |
----------------|----------|----------|----------|----------|----------------|

I have setup a reproducible repository at https://github.com/vvo/test-coverage-jest.

Debug data:

> node -v
v6.2.2

> npm -v
3.9.5

> npm ls
test-coverage-jest@1.0.0 /home/vvo/Dev/Algolia/test-coverage
├─┬ babel-plugin-istanbul@1.0.0
│ ├─┬ find-up@1.1.2
│ │ ├── path-exists@2.1.0
│ │ └─┬ pinkie-promise@2.0.1
│ │   └── pinkie@2.0.4
│ ├─┬ istanbul-lib-instrument@1.1.0-alpha.1
│ │ ├─┬ babel-generator@6.11.0
│ │ │ └─┬ detect-indent@3.0.1
│ │ │   ├── get-stdin@4.0.1
│ │ │   └─┬ repeating@1.1.3
│ │ │     └── is-finite@1.0.1
│ │ ├── babel-template@6.9.0
│ │ ├─┬ babel-traverse@6.10.4
│ │ │ ├── globals@8.18.0
│ │ │ └─┬ invariant@2.2.1
│ │ │   └─┬ loose-envify@1.2.0
│ │ │     └── js-tokens@1.0.3
│ │ ├─┬ babel-types@6.11.1
│ │ │ ├── esutils@2.0.2
│ │ │ └── to-fast-properties@1.0.2
│ │ ├── babylon@6.8.2
│ │ └── istanbul-lib-coverage@1.0.0-alpha.4
│ └─┬ test-exclude@1.1.0
│   ├── arrify@1.0.1
│   ├── lodash.assign@4.0.9
│   ├─┬ micromatch@2.3.10
│   │ ├─┬ arr-diff@2.0.0
│   │ │ └── arr-flatten@1.0.1
│   │ ├── array-unique@0.2.1
│   │ ├─┬ braces@1.8.5
│   │ │ ├─┬ expand-range@1.8.2
│   │ │ │ └─┬ fill-range@2.2.3
│   │ │ │   ├── is-number@2.1.0
│   │ │ │   ├── isobject@2.1.0
│   │ │ │   ├── randomatic@1.1.5
│   │ │ │   └── repeat-string@1.5.4
│   │ │ ├── preserve@0.2.0
│   │ │ └── repeat-element@1.1.2
│   │ ├─┬ expand-brackets@0.1.5
│   │ │ └── is-posix-bracket@0.1.1
│   │ ├── extglob@0.3.2
│   │ ├── filename-regex@2.0.0
│   │ ├── is-extglob@1.0.0
│   │ ├── is-glob@2.0.1
│   │ ├─┬ kind-of@3.0.3
│   │ │ └── is-buffer@1.1.3
│   │ ├── normalize-path@2.0.1
│   │ ├─┬ object.omit@2.0.0
│   │ │ ├─┬ for-own@0.1.4
│   │ │ │ └── for-in@0.1.5
│   │ │ └── is-extendable@0.1.1
│   │ ├─┬ parse-glob@3.0.4
│   │ │ ├─┬ glob-base@0.3.0
│   │ │ │ └── glob-parent@2.0.0
│   │ │ └── is-dotfile@1.0.2
│   │ └─┬ regex-cache@0.4.3
│   │   ├── is-equal-shallow@0.1.3
│   │   └── is-primitive@2.0.0
│   ├─┬ read-pkg-up@1.0.1
│   │ └─┬ read-pkg@1.1.0
│   │   ├─┬ normalize-package-data@2.3.5
│   │   │ ├── hosted-git-info@2.1.5
│   │   │ ├─┬ is-builtin-module@1.0.0
│   │   │ │ └── builtin-modules@1.1.1
│   │   │ └─┬ validate-npm-package-license@3.0.1
│   │   │   ├─┬ spdx-correct@1.0.2
│   │   │   │ └── spdx-license-ids@1.2.1
│   │   │   └─┬ spdx-expression-parse@1.0.2
│   │   │     └── spdx-exceptions@1.0.4
│   │   └── path-type@1.1.0
│   └── require-main-filename@1.0.1
├─┬ babel-polyfill@6.9.1
│ ├── babel-runtime@6.9.2
│ ├── core-js@2.4.0
│ └── regenerator-runtime@0.9.5
├─┬ babel-preset-es2015@6.9.0
│ ├── babel-plugin-check-es2015-constants@6.8.0
│ ├── babel-plugin-transform-es2015-arrow-functions@6.8.0
│ ├── babel-plugin-transform-es2015-block-scoped-functions@6.8.0
│ ├── babel-plugin-transform-es2015-block-scoping@6.10.1
│ ├─┬ babel-plugin-transform-es2015-classes@6.9.0
│ │ ├── babel-helper-define-map@6.9.0
│ │ ├── babel-helper-function-name@6.8.0
│ │ ├── babel-helper-optimise-call-expression@6.8.0
│ │ ├── babel-helper-replace-supers@6.8.0
│ │ └── babel-messages@6.8.0
│ ├── babel-plugin-transform-es2015-computed-properties@6.8.0
│ ├── babel-plugin-transform-es2015-destructuring@6.9.0
│ ├── babel-plugin-transform-es2015-duplicate-keys@6.8.0
│ ├── babel-plugin-transform-es2015-for-of@6.8.0
│ ├── babel-plugin-transform-es2015-function-name@6.9.0
│ ├── babel-plugin-transform-es2015-literals@6.8.0
│ ├─┬ babel-plugin-transform-es2015-modules-commonjs@6.10.3
│ │ └── babel-plugin-transform-strict-mode@6.8.0
│ ├── babel-plugin-transform-es2015-object-super@6.8.0
│ ├─┬ babel-plugin-transform-es2015-parameters@6.9.0
│ │ ├─┬ babel-helper-call-delegate@6.8.0
│ │ │ └── babel-helper-hoist-variables@6.8.0
│ │ └── babel-helper-get-function-arity@6.8.0
│ ├── babel-plugin-transform-es2015-shorthand-properties@6.8.0
│ ├── babel-plugin-transform-es2015-spread@6.8.0
│ ├─┬ babel-plugin-transform-es2015-sticky-regex@6.8.0
│ │ └── babel-helper-regex@6.9.0
│ ├── babel-plugin-transform-es2015-template-literals@6.8.0
│ ├── babel-plugin-transform-es2015-typeof-symbol@6.8.0
│ ├─┬ babel-plugin-transform-es2015-unicode-regex@6.11.0
│ │ └─┬ regexpu-core@2.0.0
│ │   ├── regenerate@1.3.1
│ │   ├── regjsgen@0.2.0
│ │   └─┬ regjsparser@0.1.5
│ │     └── jsesc@0.5.0
│ └─┬ babel-plugin-transform-regenerator@6.9.0
│   ├── babel-plugin-syntax-async-functions@6.8.0
│   └── private@0.1.6
├─┬ babel-preset-stage-2@6.11.0
│ ├─┬ babel-plugin-transform-object-rest-spread@6.8.0
│ │ └── babel-plugin-syntax-object-rest-spread@6.8.0
│ └─┬ babel-preset-stage-3@6.11.0
│   ├── babel-plugin-syntax-trailing-function-commas@6.8.0
│   ├─┬ babel-plugin-transform-async-to-generator@6.8.0
│   │ └── babel-helper-remap-async-to-generator@6.8.0
│   └─┬ babel-plugin-transform-exponentiation-operator@6.8.0
│     ├─┬ babel-helper-builder-binary-assignment-operator-visitor@6.8.0
│     │ └── babel-helper-explode-assignable-expression@6.8.0
│     └── babel-plugin-syntax-exponentiation-operator@6.8.0
├─┬ babel-register@6.9.0
│ ├─┬ babel-core@6.10.4
│ │ ├─┬ babel-code-frame@6.11.0
│ │ │ └── js-tokens@2.0.0
│ │ ├── babel-helpers@6.8.0
│ │ ├── convert-source-map@1.2.0
│ │ ├── json5@0.4.0
│ │ ├─┬ minimatch@3.0.2
│ │ │ └─┬ brace-expansion@1.1.5
│ │ │   ├── balanced-match@0.4.1
│ │ │   └── concat-map@0.0.1
│ │ ├── path-exists@1.0.0
│ │ ├── path-is-absolute@1.0.0
│ │ ├── shebang-regex@1.0.0
│ │ ├── slash@1.0.0
│ │ └── source-map@0.5.6
│ ├─┬ home-or-tmp@1.0.0
│ │ ├── os-tmpdir@1.0.1
│ │ └── user-home@1.1.1
│ ├── lodash@4.13.1
│ ├─┬ mkdirp@0.5.1
│ │ └── minimist@0.0.8
│ ├── path-exists@1.0.0
│ └─┬ source-map-support@0.2.10
│   └─┬ source-map@0.1.32
│     └── amdefine@1.0.0
├─┬ jest-cli@13.0.0
│ ├─┬ chalk@1.1.3
│ │ ├── ansi-styles@2.2.1
│ │ ├── escape-string-regexp@1.0.5
│ │ ├─┬ has-ansi@2.0.0
│ │ │ └── ansi-regex@2.0.0
│ │ ├── strip-ansi@3.0.1
│ │ └── supports-color@2.0.0
│ ├── graceful-fs@4.1.4
│ ├── jest-changed-files@13.0.0
│ ├─┬ jest-config@13.0.0
│ │ ├─┬ istanbul@0.4.4
│ │ │ ├── abbrev@1.0.9
│ │ │ ├── async@1.5.2
│ │ │ ├─┬ escodegen@1.8.0
│ │ │ │ ├── estraverse@1.9.3
│ │ │ │ ├─┬ optionator@0.8.1
│ │ │ │ │ ├── deep-is@0.1.3
│ │ │ │ │ ├── fast-levenshtein@1.1.3
│ │ │ │ │ ├── levn@0.3.0
│ │ │ │ │ ├── prelude-ls@1.1.2
│ │ │ │ │ └── type-check@0.3.2
│ │ │ │ └── source-map@0.2.0
│ │ │ ├── esprima@2.7.2
│ │ │ ├─┬ fileset@0.2.1
│ │ │ │ ├─┬ glob@5.0.15
│ │ │ │ │ └── inflight@1.0.5
│ │ │ │ └── minimatch@2.0.10
│ │ │ ├─┬ handlebars@4.0.5
│ │ │ │ ├─┬ optimist@0.6.1
│ │ │ │ │ ├── minimist@0.0.10
│ │ │ │ │ └── wordwrap@0.0.3
│ │ │ │ ├── source-map@0.4.4
│ │ │ │ └─┬ uglify-js@2.6.4
│ │ │ │   ├── async@0.2.10
│ │ │ │   ├── 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
│ │ │ │     │ │ │ └── longest@1.0.1
│ │ │ │     │ │ └── lazy-cache@1.0.4
│ │ │ │     │ ├── right-align@0.1.3
│ │ │ │     │ └── wordwrap@0.0.2
│ │ │ │     └── window-size@0.1.0
│ │ │ ├─┬ js-yaml@3.6.1
│ │ │ │ └─┬ argparse@1.0.7
│ │ │ │   └── sprintf-js@1.0.3
│ │ │ ├── nopt@3.0.6
│ │ │ ├─┬ once@1.3.3
│ │ │ │ └── wrappy@1.0.2
│ │ │ ├─┬ supports-color@3.1.2
│ │ │ │ └── has-flag@1.0.0
│ │ │ └── wordwrap@1.0.0
│ │ ├── jest-environment-node@13.0.0
│ │ └─┬ node-notifier@4.6.0
│ │   ├─┬ cli-usage@0.1.2
│ │   │ ├── marked@0.3.5
│ │   │ ├─┬ marked-terminal@1.6.1
│ │   │ │ ├─┬ cardinal@0.5.0
│ │   │ │ │ ├── ansicolors@0.2.1
│ │   │ │ │ └─┬ redeyed@0.5.0
│ │   │ │ │   └── esprima-fb@12001.1.0-dev-harmony-fb
│ │   │ │ ├─┬ cli-table@0.3.1
│ │   │ │ │ └── colors@1.0.3
│ │   │ │ ├─┬ lodash.assign@3.2.0
│ │   │ │ │ ├─┬ lodash._createassigner@3.1.1
│ │   │ │ │ │ ├── lodash._isiterateecall@3.0.9
│ │   │ │ │ │ └── lodash.restparam@3.6.1
│ │   │ │ │ └── lodash.keys@3.1.2
│ │   │ │ └── node-emoji@0.1.0
│ │   │ └── minimist@0.2.0
│ │   ├── growly@1.3.0
│ │   ├─┬ lodash.clonedeep@3.0.2
│ │   │ ├─┬ lodash._baseclone@3.3.0
│ │   │ │ ├── lodash._arraycopy@3.0.0
│ │   │ │ ├── lodash._arrayeach@3.0.0
│ │   │ │ ├─┬ lodash._baseassign@3.2.0
│ │   │ │ │ ├── lodash._basecopy@3.0.1
│ │   │ │ │ └── lodash.keys@3.1.2
│ │   │ │ ├── lodash._basefor@3.0.3
│ │   │ │ ├── lodash.isarray@3.0.4
│ │   │ │ └─┬ lodash.keys@3.1.2
│ │   │ │   ├── lodash._getnative@3.9.1
│ │   │ │   └── lodash.isarguments@3.0.8
│ │   │ └── lodash._bindcallback@3.0.1
│ │   ├── semver@5.2.0
│ │   └── shellwords@0.1.0
│ ├─┬ jest-environment-jsdom@13.0.0
│ │ └─┬ jsdom@9.3.0
│ │   ├── abab@1.0.3
│ │   ├── acorn@2.7.0
│ │   ├── acorn-globals@1.0.9
│ │   ├── array-equal@1.0.0
│ │   ├── cssom@0.3.1
│ │   ├── cssstyle@0.2.36
│ │   ├── iconv-lite@0.4.13
│ │   ├── nwmatcher@1.3.8
│ │   ├── parse5@1.5.1
│ │   ├─┬ request@2.72.0
│ │   │ ├── aws-sign2@0.6.0
│ │   │ ├── aws4@1.4.1
│ │   │ ├─┬ bl@1.1.2
│ │   │ │ └─┬ readable-stream@2.0.6
│ │   │ │   ├── core-util-is@1.0.2
│ │   │ │   ├── isarray@1.0.0
│ │   │ │   ├── process-nextick-args@1.0.7
│ │   │ │   ├── string_decoder@0.10.31
│ │   │ │   └── util-deprecate@1.0.2
│ │   │ ├── caseless@0.11.0
│ │   │ ├─┬ combined-stream@1.0.5
│ │   │ │ └── delayed-stream@1.0.0
│ │   │ ├── extend@3.0.0
│ │   │ ├── forever-agent@0.6.1
│ │   │ ├── form-data@1.0.0-rc4
│ │   │ ├─┬ har-validator@2.0.6
│ │   │ │ ├─┬ commander@2.9.0
│ │   │ │ │ └── graceful-readlink@1.0.1
│ │   │ │ └─┬ is-my-json-valid@2.13.1
│ │   │ │   ├── generate-function@2.0.0
│ │   │ │   ├─┬ generate-object-property@1.2.0
│ │   │ │   │ └── is-property@1.0.2
│ │   │ │   └── jsonpointer@2.0.0
│ │   │ ├─┬ hawk@3.1.3
│ │   │ │ ├── boom@2.10.1
│ │   │ │ ├── cryptiles@2.0.5
│ │   │ │ ├── hoek@2.16.3
│ │   │ │ └── sntp@1.0.9
│ │   │ ├─┬ http-signature@1.1.1
│ │   │ │ ├── assert-plus@0.2.0
│ │   │ │ ├─┬ jsprim@1.3.0
│ │   │ │ │ ├── extsprintf@1.0.2
│ │   │ │ │ ├── json-schema@0.2.2
│ │   │ │ │ └── verror@1.3.6
│ │   │ │ └─┬ sshpk@1.8.3
│ │   │ │   ├── asn1@0.2.3
│ │   │ │   ├── assert-plus@1.0.0
│ │   │ │   ├─┬ dashdash@1.14.0
│ │   │ │   │ └── assert-plus@1.0.0
│ │   │ │   ├── ecc-jsbn@0.1.1
│ │   │ │   ├─┬ getpass@0.1.6
│ │   │ │   │ └── assert-plus@1.0.0
│ │   │ │   ├── jodid25519@1.0.2
│ │   │ │   ├── jsbn@0.1.0
│ │   │ │   └── tweetnacl@0.13.3
│ │   │ ├── is-typedarray@1.0.0
│ │   │ ├── isstream@0.1.2
│ │   │ ├── json-stringify-safe@5.0.1
│ │   │ ├─┬ mime-types@2.1.11
│ │   │ │ └── mime-db@1.23.0
│ │   │ ├── node-uuid@1.4.7
│ │   │ ├── oauth-sign@0.8.2
│ │   │ ├── qs@6.1.0
│ │   │ ├── stringstream@0.0.5
│ │   │ └── tunnel-agent@0.4.3
│ │   ├── sax@1.2.1
│ │   ├── symbol-tree@3.1.4
│ │   ├── tough-cookie@2.2.2
│ │   ├── webidl-conversions@3.0.1
│ │   ├─┬ whatwg-url@3.0.0
│ │   │ └── tr46@0.0.3
│ │   └── xml-name-validator@2.0.1
│ ├─┬ jest-haste-map@13.0.0
│ │ └─┬ fb-watchman@1.9.0
│ │   └─┬ bser@1.0.2
│ │     └── node-int64@0.4.0
│ ├── jest-jasmine1@13.0.0
│ ├─┬ jest-jasmine2@13.0.0
│ │ └─┬ jasmine-check@0.1.5
│ │   └── testcheck@0.1.4
│ ├── jest-mock@13.0.0
│ ├─┬ jest-resolve@13.0.0
│ │ ├── browser-resolve@1.11.2
│ │ └── resolve@1.1.7
│ ├── jest-runtime@13.0.0
│ ├─┬ jest-snapshot@13.0.0
│ │ └── pretty-format@3.3.2
│ ├─┬ jest-util@13.0.0
│ │ └── diff@2.2.3
│ ├─┬ json-stable-stringify@1.0.1
│ │ └── jsonify@0.0.0
│ ├─┬ lodash.template@4.2.5
│ │ ├── lodash._reinterpolate@3.0.0
│ │ ├─┬ lodash.assigninwith@4.0.7
│ │ │ └── lodash.keysin@4.1.4
│ │ ├── lodash.keys@4.0.7
│ │ ├── lodash.rest@4.0.3
│ │ ├─┬ lodash.templatesettings@4.0.1
│ │ │ └── lodash.escape@4.0.0
│ │ └── lodash.tostring@4.1.3
│ ├─┬ sane@1.3.5
│ │ ├─┬ exec-sh@0.2.0
│ │ │ └── merge@1.2.0
│ │ ├── minimist@1.2.0
│ │ ├─┬ walker@1.0.7
│ │ │ └─┬ makeerror@1.0.11
│ │ │   └── tmpl@1.0.4
│ │ └── watch@0.10.0
│ ├─┬ which@1.2.10
│ │ └── isexe@1.1.2
│ ├─┬ worker-farm@1.3.1
│ │ ├─┬ errno@0.1.4
│ │ │ └── prr@0.0.0
│ │ └── xtend@4.0.1
│ └─┬ yargs@4.7.1
│   ├── camelcase@3.0.0
│   ├─┬ cliui@3.2.0
│   │ └── wrap-ansi@2.0.0
│   ├── decamelize@1.2.0
│   ├─┬ os-locale@1.4.0
│   │ └─┬ lcid@1.0.0
│   │   └── invert-kv@1.0.0
│   ├─┬ pkg-conf@1.1.3
│   │ ├─┬ load-json-file@1.1.0
│   │ │ ├─┬ parse-json@2.2.0
│   │ │ │ └─┬ error-ex@1.3.0
│   │ │ │   └── is-arrayish@0.2.1
│   │ │ ├── pify@2.3.0
│   │ │ └─┬ strip-bom@2.0.0
│   │ │   └── is-utf8@0.2.1
│   │ ├── object-assign@4.1.0
│   │ └── symbol@0.2.3
│   ├── set-blocking@1.0.0
│   ├─┬ string-width@1.0.1
│   │ ├─┬ code-point-at@1.0.0
│   │ │ └── number-is-nan@1.0.0
│   │ └── is-fullwidth-code-point@1.0.0
│   ├── window-size@0.2.0
│   ├── y18n@3.2.1
│   └─┬ yargs-parser@2.4.0
│     └── camelcase@2.1.1
├─┬ mocha@2.5.3
│ ├── commander@2.3.0
│ ├─┬ debug@2.2.0
│ │ └── ms@0.7.1
│ ├── diff@1.4.0
│ ├── escape-string-regexp@1.0.2
│ ├─┬ glob@3.2.11
│ │ ├── inherits@2.0.1
│ │ └─┬ minimatch@0.3.0
│ │   ├── lru-cache@2.7.3
│ │   └── sigmund@1.0.1
│ ├── growl@1.9.2
│ ├─┬ jade@0.26.3
│ │ ├── commander@0.6.1
│ │ └── mkdirp@0.3.0
│ ├── supports-color@1.2.0
│ └── to-iso-string@0.0.2
└─┬ nyc@6.6.1
  ├── append-transform@0.4.0
  ├── arrify@1.0.1
  ├─┬ caching-transform@1.0.1
  │ └─┬ write-file-atomic@1.1.4
  │   ├── graceful-fs@4.1.4
  │   ├── imurmurhash@0.1.4
  │   └── slide@1.1.6
  ├── convert-source-map@1.2.0
  ├─┬ default-require-extensions@1.0.0
  │ └─┬ strip-bom@2.0.0
  │   └── is-utf8@0.2.1
  ├─┬ find-cache-dir@0.1.1
  │ ├── commondir@1.0.1
  │ └── pkg-dir@1.0.0
  ├─┬ find-up@1.1.2
  │ ├── path-exists@2.1.0
  │ └─┬ pinkie-promise@2.0.1
  │   └── pinkie@2.0.4
  ├─┬ foreground-child@1.5.1
  │ ├─┬ cross-spawn-async@2.2.4
  │ │ └─┬ lru-cache@4.0.1
  │ │   ├── pseudomap@1.0.2
  │ │   └── yallist@2.0.0
  │ ├── signal-exit@2.1.2
  │ └─┬ which@1.2.10
  │   └── isexe@1.1.2
  ├─┬ glob@7.0.3
  │ ├─┬ inflight@1.0.5
  │ │ └── wrappy@1.0.2
  │ ├── inherits@2.0.1
  │ ├─┬ minimatch@3.0.0
  │ │ └─┬ brace-expansion@1.1.4
  │ │   ├── balanced-match@0.4.1
  │ │   └── concat-map@0.0.1
  │ ├─┬ once@1.3.3
  │ │ └── wrappy@1.0.2
  │ └── path-is-absolute@1.0.0
  ├─┬ istanbul@0.4.3
  │ ├── abbrev@1.0.7
  │ ├── async@1.5.2
  │ ├─┬ escodegen@1.8.0
  │ │ ├── estraverse@1.9.3
  │ │ ├── esutils@2.0.2
  │ │ ├─┬ optionator@0.8.1
  │ │ │ ├── deep-is@0.1.3
  │ │ │ ├── fast-levenshtein@1.1.3
  │ │ │ ├── levn@0.3.0
  │ │ │ ├── prelude-ls@1.1.2
  │ │ │ └── type-check@0.3.2
  │ │ └─┬ source-map@0.2.0
  │ │   └── amdefine@1.0.0
  │ ├── esprima@2.7.2
  │ ├─┬ fileset@0.2.1
  │ │ ├─┬ glob@5.0.15
  │ │ │ ├─┬ inflight@1.0.5
  │ │ │ │ └── wrappy@1.0.2
  │ │ │ ├── inherits@2.0.1
  │ │ │ └── path-is-absolute@1.0.0
  │ │ └─┬ minimatch@2.0.10
  │ │   └─┬ brace-expansion@1.1.4
  │ │     ├── balanced-match@0.4.1
  │ │     └── concat-map@0.0.1
  │ ├─┬ handlebars@4.0.5
  │ │ ├─┬ optimist@0.6.1
  │ │ │ ├── minimist@0.0.10
  │ │ │ └── wordwrap@0.0.3
  │ │ ├─┬ source-map@0.4.4
  │ │ │ └── amdefine@1.0.0
  │ │ └─┬ uglify-js@2.6.2
  │ │   ├── async@0.2.10
  │ │   ├── source-map@0.5.6
  │ │   ├── 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.0.3
  │ │     │ │ │ │ └── is-buffer@1.1.3
  │ │     │ │ │ ├── longest@1.0.1
  │ │     │ │ │ └── repeat-string@1.5.4
  │ │     │ │ └── lazy-cache@1.0.4
  │ │     │ ├─┬ right-align@0.1.3
  │ │     │ │ └─┬ align-text@0.1.4
  │ │     │ │   ├─┬ kind-of@3.0.3
  │ │     │ │   │ └── is-buffer@1.1.3
  │ │     │ │   ├── longest@1.0.1
  │ │     │ │   └── repeat-string@1.5.4
  │ │     │ └── wordwrap@0.0.2
  │ │     ├── decamelize@1.2.0
  │ │     └── window-size@0.1.0
  │ ├─┬ js-yaml@3.6.1
  │ │ └─┬ argparse@1.0.7
  │ │   └── sprintf-js@1.0.3
  │ ├── nopt@3.0.6
  │ ├─┬ once@1.3.3
  │ │ └── wrappy@1.0.2
  │ ├── resolve@1.1.7
  │ ├─┬ supports-color@3.1.2
  │ │ └── has-flag@1.0.0
  │ ├─┬ which@1.2.10
  │ │ └── isexe@1.1.2
  │ └── wordwrap@1.0.0
  ├─┬ md5-hex@1.3.0
  │ └── md5-o-matic@0.1.1
  ├─┬ micromatch@2.3.8
  │ ├─┬ arr-diff@2.0.0
  │ │ └── arr-flatten@1.0.1
  │ ├── array-unique@0.2.1
  │ ├─┬ braces@1.8.5
  │ │ ├─┬ expand-range@1.8.2
  │ │ │ └─┬ fill-range@2.2.3
  │ │ │   ├── is-number@2.1.0
  │ │ │   ├─┬ isobject@2.1.0
  │ │ │   │ └── isarray@1.0.0
  │ │ │   ├── randomatic@1.1.5
  │ │ │   └── repeat-string@1.5.4
  │ │ ├── preserve@0.2.0
  │ │ └── repeat-element@1.1.2
  │ ├─┬ expand-brackets@0.1.5
  │ │ └── is-posix-bracket@0.1.1
  │ ├── extglob@0.3.2
  │ ├── filename-regex@2.0.0
  │ ├── is-extglob@1.0.0
  │ ├── is-glob@2.0.1
  │ ├─┬ kind-of@3.0.3
  │ │ └── is-buffer@1.1.3
  │ ├── normalize-path@2.0.1
  │ ├─┬ object.omit@2.0.0
  │ │ ├─┬ for-own@0.1.4
  │ │ │ └── for-in@0.1.5
  │ │ └── is-extendable@0.1.1
  │ ├─┬ parse-glob@3.0.4
  │ │ ├─┬ glob-base@0.3.0
  │ │ │ └── glob-parent@2.0.0
  │ │ └── is-dotfile@1.0.2
  │ └─┬ regex-cache@0.4.3
  │   ├── is-equal-shallow@0.1.3
  │   └── is-primitive@2.0.0
  ├─┬ mkdirp@0.5.1
  │ └── minimist@0.0.8
  ├── pkg-up@1.0.0
  ├── resolve-from@2.0.0
  ├── rimraf@2.5.2
  ├── signal-exit@3.0.0
  ├── source-map@0.5.6
  ├─┬ spawn-wrap@1.2.3
  │ ├── os-homedir@1.0.1
  │ ├── signal-exit@2.1.2
  │ └─┬ which@1.2.10
  │   └── isexe@1.1.2
  ├─┬ test-exclude@1.1.0
  │ ├─┬ lodash.assign@4.0.9
  │ │ ├── lodash.keys@4.0.7
  │ │ └── lodash.rest@4.0.3
  │ ├─┬ read-pkg-up@1.0.1
  │ │ └─┬ read-pkg@1.1.0
  │ │   ├─┬ load-json-file@1.1.0
  │ │   │ ├── graceful-fs@4.1.4
  │ │   │ ├─┬ parse-json@2.2.0
  │ │   │ │ └─┬ error-ex@1.3.0
  │ │   │ │   └── is-arrayish@0.2.1
  │ │   │ ├── pify@2.3.0
  │ │   │ ├─┬ pinkie-promise@2.0.1
  │ │   │ │ └── pinkie@2.0.4
  │ │   │ └─┬ strip-bom@2.0.0
  │ │   │   └── is-utf8@0.2.1
  │ │   ├─┬ normalize-package-data@2.3.5
  │ │   │ ├── hosted-git-info@2.1.5
  │ │   │ ├─┬ is-builtin-module@1.0.0
  │ │   │ │ └── builtin-modules@1.1.1
  │ │   │ ├── semver@5.1.0
  │ │   │ └─┬ validate-npm-package-license@3.0.1
  │ │   │   ├─┬ spdx-correct@1.0.2
  │ │   │   │ └── spdx-license-ids@1.2.1
  │ │   │   └─┬ spdx-expression-parse@1.0.2
  │ │   │     ├── spdx-exceptions@1.0.4
  │ │   │     └── spdx-license-ids@1.2.1
  │ │   └─┬ path-type@1.1.0
  │ │     ├── graceful-fs@4.1.4
  │ │     ├── pify@2.3.0
  │ │     └─┬ pinkie-promise@2.0.1
  │ │       └── pinkie@2.0.4
  │ └── require-main-filename@1.0.1
  └─┬ yargs@4.7.1
    ├── camelcase@3.0.0
    ├─┬ cliui@3.2.0
    │ ├─┬ strip-ansi@3.0.1
    │ │ └── ansi-regex@2.0.0
    │ └── wrap-ansi@2.0.0
    ├── decamelize@1.2.0
    ├─┬ lodash.assign@4.0.9
    │ ├── lodash.keys@4.0.7
    │ └── lodash.rest@4.0.3
    ├─┬ os-locale@1.4.0
    │ └─┬ lcid@1.0.0
    │   └── invert-kv@1.0.0
    ├─┬ pkg-conf@1.1.3
    │ ├─┬ load-json-file@1.1.0
    │ │ ├── graceful-fs@4.1.4
    │ │ ├─┬ parse-json@2.2.0
    │ │ │ └─┬ error-ex@1.3.0
    │ │ │   └── is-arrayish@0.2.1
    │ │ ├── pify@2.3.0
    │ │ ├─┬ pinkie-promise@2.0.1
    │ │ │ └── pinkie@2.0.4
    │ │ └─┬ strip-bom@2.0.0
    │ │   └── is-utf8@0.2.1
    │ ├── object-assign@4.1.0
    │ └── symbol@0.2.3
    ├─┬ read-pkg-up@1.0.1
    │ └─┬ read-pkg@1.1.0
    │   ├─┬ load-json-file@1.1.0
    │   │ ├── graceful-fs@4.1.4
    │   │ ├─┬ parse-json@2.2.0
    │   │ │ └─┬ error-ex@1.3.0
    │   │ │   └── is-arrayish@0.2.1
    │   │ ├── pify@2.3.0
    │   │ ├─┬ pinkie-promise@2.0.1
    │   │ │ └── pinkie@2.0.4
    │   │ └─┬ strip-bom@2.0.0
    │   │   └── is-utf8@0.2.1
    │   ├─┬ normalize-package-data@2.3.5
    │   │ ├── hosted-git-info@2.1.5
    │   │ ├─┬ is-builtin-module@1.0.0
    │   │ │ └── builtin-modules@1.1.1
    │   │ ├── semver@5.1.0
    │   │ └─┬ validate-npm-package-license@3.0.1
    │   │   ├─┬ spdx-correct@1.0.2
    │   │   │ └── spdx-license-ids@1.2.1
    │   │   └─┬ spdx-expression-parse@1.0.2
    │   │     ├── spdx-exceptions@1.0.4
    │   │     └── spdx-license-ids@1.2.1
    │   └─┬ path-type@1.1.0
    │     ├── graceful-fs@4.1.4
    │     ├── pify@2.3.0
    │     └─┬ pinkie-promise@2.0.1
    │       └── pinkie@2.0.4
    ├── require-main-filename@1.0.1
    ├── set-blocking@1.0.0

    │ ├─┬ code-point-at@1.0.0
    │ │ └── number-is-nan@1.0.0
    │ ├─┬ is-fullwidth-code-point@1.0.0
    │ │ └── number-is-nan@1.0.0
    │ └─┬ strip-ansi@3.0.1
    │   └── ansi-regex@2.0.0
    ├── window-size@0.2.0
    ├── y18n@3.2.1
    └─┬ yargs-parser@2.4.0
      └── camelcase@2.1.1
@vvo
Copy link
Contributor Author

vvo commented Jul 7, 2016

Simple ping here, just wondering if my issue is an actual issue. I have somehow trouble getting good coverage support with jest + babel or even jest + ES5 code like in this example.

If coverage is not completely working today, maybe we should say so in the README?

@cpojer
Copy link
Member

cpojer commented Jul 7, 2016

We are working on improving code coverage over the next few months. cc @DmitriiAbramov.

@vvo
Copy link
Contributor Author

vvo commented Jul 7, 2016

Yep that's why I thought we could update the documentation to reflect the coverage status of today, to avoid people spending a lot of time on it.

@cpojer
Copy link
Member

cpojer commented Aug 16, 2016

I'm assuming this is fixed now. @DmitriiAbramov rewrote Jest's code coverage support. Please try with jest@test or jest@14.2.2-alpha.22bd3c33 to see if this issue still persists. If it does, we'll reopen this issue.

@cpojer cpojer closed this as completed Aug 16, 2016
@ManuelDeLeon
Copy link

@cpojer
I tried that version but it doesn't find my tests.

config:

  "jest": {
    "automock": false,
    "testRegex": "\\.test\\.js$",
    "testPathDirs": [
      "src/"
    ]
  }

output:

NO TESTS FOUND. 69 files checked.
  testPathDirs: C:\MyFiles\React\viewmodel-react-docs\src - 0 matches
  testRegex: \.test\.js$ - 2 matches
  testPathIgnorePatterns: \\node_modules\\ - 69 matches

@cpojer
Copy link
Member

cpojer commented Aug 17, 2016

The current pre-release might have an issue on windows that we'll need to resolve before the final then. Sorry about that.

@Daniel15
Copy link
Contributor

Looks like the issue on Windows blames to #1379 (b56e368). I created a separate issue to look into it: #1462. Thanks for reporting, @ManuelDeLeon!

phra added a commit to phra/jest that referenced this issue Dec 25, 2017
cpojer pushed a commit that referenced this issue Jan 8, 2018
* feat: implement spyOnProperty method, fixes #5106

* style: fix indentation of mock, runtime, jasmine2

* test: fix failing tests for spyOnProperty

* test: implement tests for #1214

* style: fix eslint errors

* refactor: proxy spyOnProperty call behind spyOn

* refactor: remove useless console.log

* style: fix eslint errors

* types: remove declaration of spyOnProperty

* docs: add documentation for accessType argument of spyOn

* docs: fix typo in spyOn docs

* test(spyOn): fix typo in should throw on invalid input

* test(spyOn): add tests for setters

* docs(spyOn): add example for spying on setters

* style: fix eslint errors

* refactor: format error messages with getErrorMsg()

* style: fix eslint errors

* revert: restore snapshotState.getUncheckedKeys()
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants