Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

Missing List.vue file in coverage report #3

Open
vitoravelino opened this issue Jan 10, 2018 · 4 comments
Open

Missing List.vue file in coverage report #3

vitoravelino opened this issue Jan 10, 2018 · 4 comments
Labels

Comments

@vitoravelino
Copy link

Hello there!

I pulled the code, ran npm install and List.vue does not appear in the coverage report files. Is that expected?

 WEBPACK  Compiled successfully in 476ms

 MOCHA  Testing...



  List.vue
    ✓ renders li for each item in props.items

  Message
    ✓ renders props.msg when passed
    ✓ renders default message if not passed a prop

  MessageToggle.vue
    ✓ toggles msg passed to Message when button is clicked


  4 passing (26ms)

 MOCHA  Tests completed successfully

----------------------------|----------|----------|----------|----------|----------------|
File                        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------------------------|----------|----------|----------|----------|----------------|
All files                   |      100 |      100 |      100 |      100 |                |
 Message.js                 |      100 |      100 |      100 |      100 |                |
 MessageToggle.vue?d4b1857c |      100 |      100 |      100 |      100 |                |
----------------------------|----------|----------|----------|----------|----------------|
@vitoravelino
Copy link
Author

Also, I passed --reporter=html to check the output in the browser and when I opened the vue file I got:

Unable to lookup source: /home/vitoravelino/Workspace/others/vue-test-utils-mocha-webpack-example/src/components/MessageToggle.vue?d4b1857c(ENOENT: no such file or directory, open '/home/vitoravelino/Workspace/others/vue-test-utils-mocha-webpack-example/src/components/MessageToggle.vue?d4b1857c')

@dbschwartz
Copy link
Contributor

dbschwartz commented Mar 22, 2018

I had the same problem! I found the issue answered here in the nyc issue page. Looks like if you change devtool: 'inline-cheap-module-source-map' to devtool:'eval' in webpack.config.js it works! Although, this is not what mocha-webpack recommends in their documentation it seems to be a good workaround. The inline-cheap-module-source-map seems to be incompatible with .vue files.

@vitoravelino
Copy link
Author

Thanks for the tip, @dbschwartz. I'll check that out later!

@dbschwartz
Copy link
Contributor

No prob @vitoravelino! It's actually devtool not dev. My bad. I fixed the original post

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

No branches or pull requests

3 participants