GithubHelp home page GithubHelp logo

Comments (3)

nvh95 avatar nvh95 commented on June 15, 2024

Hi @TheJaredWilcurt. Thanks for reporting this issue.

jest-preview can work on any framework based on jsdom, so it doesn't matter if it's @vue/test-utils or @testing-library/vue. The example here uses @testing-library/vue just for demonstration purpose.

Did you try to integrate jest-preview with @vue/test-utils? If yes, can you share the outcome/ behaviors, it would help a lot. If not, can you help to try it? (Just run jest-preview CLI and execute debug() in your tests)

from jest-preview.

TheJaredWilcurt avatar TheJaredWilcurt commented on June 15, 2024

Yes, after doing the dev.to setup I linked, I swapped @testing-library/vue out for @vue/test-utils. And changed from render to shallowMount (or mount, tried both).

Then added expect(2).toEqual(3) to for a test to fail (this worked before to show the component in the browser, in the same test). But it doesn't work, the browser refreshes, but the <body> is empty (except for the same <script> tag that was there before). Same thing with debug().

from jest-preview.

TheJaredWilcurt avatar TheJaredWilcurt commented on June 15, 2024

Here I made a reproduction:

It works with Testing Library, but not Vue Test Utils

If you can figure out how to make it work with Vue Test Utils, then that PR could be changed to npm uninstall @testing-library/vue and remove it from the import in that testing file. Then it would be read to be merged, retaining the testing-library example you already had, but also replacing it with Vue-Test-Utils as the default Vue implementation reference.

from jest-preview.

Related Issues (20)

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.