vuejs / vue-jest

Jest Vue transformer
MIT License
746 stars 157 forks source link

Using CSS Modules and PostCSS Nested doesn't work in tests #459

Closed talkor closed 2 years ago

talkor commented 2 years ago

When using <style module> along with postcss-nested results in an error in tests:

undefined:29:3: missing '}'

Using: vue: 2.6.11 postcss-nested: 4.2.3 any version of vue2-jest

Example repo: https://github.com/talkor/vue-jest-bug

Run yarn test:unit to get the above error

Is there a way to use both in tests without "losing" the class names (i.e. empty classes or undefined in class names in tests)? Thanks

lmiller1990 commented 2 years ago

I wonder if this PR (now released under vue/vue3-jest and vue/vue2-jest, both v27) fixed your issue? https://github.com/vuejs/vue-jest/pull/425#issuecomment-1108234444

talkor commented 2 years ago

I wonder if this PR (now released under vue/vue3-jest and vue/vue2-jest, both v27) fixed your issue? #425 (comment)

It is working well now in v27, thanks @lmiller1990 !