Code Monkey home page Code Monkey logo

Comments (7)

nothingismagick avatar nothingismagick commented on May 18, 2024 1

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.

eddyerburgh avatar eddyerburgh commented on May 18, 2024

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.

dbschwartz avatar dbschwartz commented on May 18, 2024

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.

nothingismagick avatar nothingismagick commented on May 18, 2024

@eddyerburgh - so what is the suggested approach to get the template block covered?

from vue-test-utils-mocha-webpack-example.

nothingismagick avatar nothingismagick commented on May 18, 2024

@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.

dbschwartz avatar dbschwartz commented on May 18, 2024

@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?

image

from vue-test-utils-mocha-webpack-example.

folmert avatar folmert commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.