question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't pass vetur plugin unit test

See original GitHub issue

Before you submit an issue we recommend you drop into the Gitter community and ask any questions you have or mention any problems you’ve had getting started with prettyhtml.

🐛 Bug Report

since the 0.8.2 version seems can’t pass the vetur unit test.(https://github.com/vuejs/vetur/blob/master/test/lsp/formatting/basic.test.ts),I think the 0.8.2`s update don’t change the template behavior,but 0.8.1 version can pass the test unit ,0.8.2 can’t.

I also run npx prettyhtml VueHNUserView.vue two times,the result is different.

Is it expect?

To Reproduce

Default config.

Steps to reproduce the behavior: the input is copy from vetur unit test https://github.com/vuejs/vetur/blob/master/test/fixture/client/formatting/VueHNUserView.vue Paste your markup here:

<template>
  <div class="user-view">
    <template v-if="user">
      <h1>User : {{ user.id }}</h1>
      <ul class="meta">
        <li><span class="label">Created:</span> {{ user.created | timeAgo }} ago</li>
        <li><span class="label">Karma:</span> {{ user.karma }}</li>
        <li v-if="user.about" v-html="user.about" class="about"></li>
      </ul>
      <p class="links">
        <a :href="'https://news.ycombinator.com/submitted?id=' + user.id">submissions</a> |
        <a :href="'https://news.ycombinator.com/threads?id=' + user.id">comments</a>
      </p>
    </template>
    <template v-else-if="user === false">
      <h1>User not found.</h1>
    </template>
  </div>
</template>

Expected behavior

A clear and concise description of what you expected to happen.

Paste the results here:

<template>
  <div class="user-view">
    <template v-if="user">
      <h1>User : {{ user.id }}</h1>
      <ul class="meta">
        <li>
          <span class="label">Created:</span>
          {{ user.created | timeAgo }} ago
        </li>
        <li>
          <span class="label">Karma:</span>
          {{ user.karma }}
        </li>
        <li v-if="user.about" v-html="user.about" class="about"></li>
      </ul>
      <p class="links">
        <a :href="'https://news.ycombinator.com/submitted?id=' + user.id">submissions</a>|
        <a :href="'https://news.ycombinator.com/threads?id=' + user.id">comments</a>
      </p>
    </template>
    <template v-else-if="user === false">
      <h1>User not found.</h1>
    </template>
  </div>
</template>

Context

Vue

Your Environment

  • Prettyhtml version: 0.8.2
  • NodeJs version:8.12
  • Environment name and version:
  • Operating System and version:macos

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
xiaomingpluscommented, Nov 25, 2018

@StarpTech a tag end have a whitespace between |,is it expected? vetur unit test don’t have a whitespace.

<a :href="'https://news.ycombinator.com/submitted?id=' + user.id">submissions</a> |
0reactions
xiaomingpluscommented, Nov 25, 2018

thanks, @StarpTech ,I’ll give a pr to vetur~

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use typescript correctly? · Issue #255 · vuejs/vue-test ...
I have recently started writing Vue unit tests using Jest + Typescript + Vue test utils, however i'm facing an issue where passing...
Read more >
Vue unit tests - cannot read property 't' of undefined
I expect this test to pass, but instead I'm getting TypeError: Cannot read property 't' of undefined . For reference, I was following...
Read more >
FAQ | Vetur - GitHub Pages
Run command: Developer: Reinstall Extension for Vetur. ... If it says cannot find module <some-module> , go to Vetur's client code installation directory ......
Read more >
How to Setup Vue.js with VS Code and Fix Formatting and ES ...
Your browser can't play this video. ... post with code that you can copy and paste into your project: https://jong.io/vuejs- vetur -vscode-fo.
Read more >
Unit Testing in Vue.js - with Gwen Faraday - YouTube
Watch live as Gwen Faraday demonstrates how to do unit testing in Vue.js.Check out Gwen's channel ... Your browser can't play this video....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found