vire / jest-vue-preprocessor

Preprocessor that allows importing of .vue files in jest tests
MIT License
130 stars 27 forks source link

fix: transform uses placeholderPattern: false #163

Closed jeremyjh closed 4 years ago

jeremyjh commented 4 years ago

We explicitly disable placeholderPatterns to prevent compilation errors of valid Vue.js templates using Babel 7 transform.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

You can see in the failing test case that a valid Vue.js template is not compiled successfully if it has all caps alone between two-tags. Babel transform assumes this is the start of a placeholder pattern unless it is explicitly told not to do that.

image

What is the new behavior?

Valid Vue.js templates are always compiled.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

This issue is referenced here:

https://github.com/babel/babel/issues/8067

codecov-io commented 4 years ago

Codecov Report

Merging #163 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #163   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines           6      6           
=====================================
  Hits            6      6
Impacted Files Coverage Δ
test/fixtures/FooComponent.vue 100% <ø> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f77774d...11ec757. Read the comment docs.