Comments (7)
This seems like an excellent question to ask at the Vue Contributor Day next week.
https://medium.com/@thisdotmedia/introducing-vue-contributor-days-2a281f16042d
from vue-test-utils-mocha-webpack-example.
Thanks, would you be able to make a PR with the fix you found?
In regards to the sourcemap. vue-loader doesn't create source maps for the template block.
from vue-test-utils-mocha-webpack-example.
Hey Edd,
Absolutely! I have a question though. Do you know if source maps for the template block are in the works for code coverage in Jest or mocha-webpack? My company is pursuing Vue unit testing but it seems difficult to navigate this space without template code coverage since it is such a major part of the Vue SFC component. I also tried to get coverage going in the vue-test-utils-jest-example but I seemed to get only 0% in despite passing tests.
Any input would so much appreciated!
Thank you so much,
Dave
from vue-test-utils-mocha-webpack-example.
@eddyerburgh - so what is the suggested approach to get the template block covered?
from vue-test-utils-mocha-webpack-example.
@dbschwartz - did you find out anything regarding this? I would love to know, because at the moment I am building a suite of test-runners into "quasar-cli" (ada, istanbul/nyc, jest, mocha, mocha-webpack, tap, karma, cypress, nightwatch AND lighthouse) and would love to know if any one of them dives into the sourcemaps...
from vue-test-utils-mocha-webpack-example.
@nothingismagick, this is actually part of a greater problem. Notice in the screenshot below, I am inspecting the sourcemap of the Vue SFC file with Chrome Dev Tools but there is no clickable breakpoint for the template part even though it is classic breakpoint material, a conditional expression. The template compiler in Vue Loader doesn't seem to provide sourcemap information for breakpoints and code coverage and this is what is used in the mocha-webpack set up. This would probably need to go back to the Vue Loader team, if it can in fact be implemented. Vue Jest is what is used in lieu of Vue Loader for testing within Jest, but I can't seem to get coverage to run to output in that environment at all. @eddyerburgh does coverage and specifically coverage for the template portion work with Vue Jest?
from vue-test-utils-mocha-webpack-example.
Is it even possible to have template block covered in single file components? It seems as if Coverage reporter ignores <template>
completely and checks only what's in the <script>
tag.
from vue-test-utils-mocha-webpack-example.
Related Issues (11)
- broken link readme.md HOT 2
- Needs updated to use Vue CLI 3.0 and latest version of vue-test-utils HOT 1
- please update to recent vue-loader with vueloaderplugin HOT 3
- --watch mode stops reporting all test results on code/test updates HOT 1
- if you delete the package-lock.json and npm install tests do not work HOT 1
- Critical vulnerabilities in the setup HOT 1
- how run vue-test with mocha+pactjs?
- Missing `List.vue` file in coverage report HOT 4
- MessageToggle.vue test failed HOT 5
- vue-loader v15 requires VueLoaderPlugin in webpack config
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-test-utils-mocha-webpack-example.