vuejs / vue-jest

Jest Vue transformer
MIT License
742 stars 159 forks source link

fix: allow importing relative paths in global resources #548

Closed pmrotule closed 10 months ago

pmrotule commented 11 months ago

It seems like the fix I've made for relative paths in global resources in vue2-jest v26 (https://github.com/vuejs/vue-jest/pull/373) has not been ported to the other versions (not in v27, v28, v29). We recently upgraded to v29 and faced the same issue so this PR is making the same changes, but for v29 in both Vue 2 and Vue 3 (I tested it and it works as expected).

More details found in my previous PR: https://github.com/vuejs/vue-jest/pull/373

pmrotule commented 10 months ago

@lmiller1990 Would you have time to have a look?

lmiller1990 commented 10 months ago

Will release this one now.

lmiller1990 commented 10 months ago

Done: https://github.com/vuejs/vue-jest/releases/tag/v29.2.6

remcobeunk commented 9 months ago

@pmrotule it seems this fix is breaking our unit test run with the error you originally fixed in this pr: https://github.com/vuejs/vue-jest/pull/373.

On Mac it works but on Windows machines it does not.

Error: Can't find stylesheet to import. ╷ 1 │ @import "XXXX path = correct and file exists"; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵

After reverting your change locally our vue2 tests start working again: image

Any ideas?

pmrotule commented 9 months ago

@remcobeunk I would need more information to debug.

Can you provide a reproduction repo or stackblitz?

remcobeunk commented 9 months ago

Our project uses SASS CSS pre-processor Global resources config? No idea which config you want, jest specifically or all configs? But because project is end of live we are not going to invest more time into this problem.

We set our project fixed to version of 29.2.5 that works for all of our developers. Sorry I cannot help you more with this.