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

Jests tests fail #1260

Open
ccamarat opened this issue Jan 22, 2018 · 3 comments
Open

Jests tests fail #1260

ccamarat opened this issue Jan 22, 2018 · 3 comments

Comments

@ccamarat
Copy link

Steps to reproduce:

  1. vue init webpack jest-test
  2. Runtime + Compiler
  3. Install Vue Router
  4. Use eSLint - Y
  5. ...config standard
  6. Set up Unit Tests - Y
  7. ...Jest
  8. Setup Nightwatch - Y
  9. Use NPM
  10. cd jest-test
  11. npm run unit

Expected Result:
Tests pass with coverage report

Actual Result:
Tests fail with error:

 FAIL  test\unit\specs\HelloWorld.spec.js
  ● Test suite failed to run

    No file coverage available for: d:\tmp\test-jest2\src\components\HelloWorld.vue

      at CoverageMap.fileCoverageFor (node_modules/istanbul-lib-coverage/lib/coverage-map.js:96:15)
          at Array.forEach (<anonymous>)

Environment:
Windows 10 / Node 8.9.3 / NPM 5.5.1

Other Info
This broke over the weekend. It's not clear to me what changed so it seems likely to me this is really problem with one of this project's dependencies, but I could use a hand tracking down which one.

@LinusBorg
Copy link
Contributor

Seems to be an upstream issue? vuejs/vue-jest#48

@ccamarat
Copy link
Author

Yea, I'm sure it is now. I was excited to start using Jest; it is much easier to setup than Jasmine or Mocha, so I was disappointed when it just stopped working.

Does this look like a Windows-only thing to you, or is it happening on other platforms?

@ccamarat
Copy link
Author

I was able to throw a couple hours at this one today. I've got a successful (if limited) workaround and was able to determine that the issue was introduced with Jest v22.0.0. I also have some info that may help someone track this down or resolve; I posted them over at the Vue-Jest repo since I'm thinking that's where the fix will be.

Work Around
Place the Jest configuration directly inside package.json following the vue test utils jest-example. If you need any type of dynamic config obviously this won't be very helpful, but maybe it'll help someone.

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

2 participants