GithubHelp home page GithubHelp logo

Comments (4)

PerpetualWar avatar PerpetualWar commented on June 9, 2024

Oh this is gold, spent days on this.

from vue-jest.

thibaudszy avatar thibaudszy commented on June 9, 2024

Thanks @threepipes for posting the solution. I also struggled to find the cause of the issue.

The straightforward solution is to simply not prettify the compilation output when processing the template. @lmiller1990, is there a use case for it in the context of this plugin? If not I'm happy to submit a PR to change this behavior (like this).

from vue-jest.

lmiller1990 avatar lmiller1990 commented on June 9, 2024

I guess the main reason to do this is for better stack traces/error messages. Although broken out of the box is definitely not ideal... should we just default to having prettier off? Any way to fix this so it works out of the box with formatting?

from vue-jest.

thibaudszy avatar thibaudszy commented on June 9, 2024

I reproduced the issue on this repo and tried to see what benefits the formatting with prettier brings by using Prettier 2 and making the test fail. With and without Prettier, the output is the same:
no-prettify

If I force an error in the template, then I can see an error in the output (location in the proxy render):

With Prettier:
Screenshot 2023-10-06 at 21 25 18

Without Prettier:
Screenshot 2023-10-06 at 21 26 44

But I don't know if this is helping a lot. Is it possible to analyse the compiled template in case of failure?

All this to say, offering the possibility to prettify the output of the template compiler might be unnecessary. If that's the case we can just solve the issue by always passing prettify:false to the compileTemplate function.

from vue-jest.

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.