vue-jest icon indicating copy to clipboard operation
vue-jest copied to clipboard

Windows: Cannot resolve SCSS files

Open annam002 opened this issue 5 years ago • 3 comments

I run into this problem on Windows with vue-jest version 3.0.4: We are using SCSS styles for vue, and in the test, no styles are loaded. It works fine in production, so the problem must be somewhere in vue-jest. It also works fine on Linux.

I can reproduce this in the v3 branch of vue-jest: when I try to run the test in scss.spec.js, some tests are failing and I get the following error messages:

[vue-jest]: There was an error rendering the SCSS in D:\workspaces\vue-jest\vue-jest-3.0.4\test\resources\ScssModule.vue. SCSS is fully supported by vue-jest. Still some features might throw errors. Webpack aliases are a common cause of errors. If you use Webpack aliases, please use jest's suggested way via moduleNameMapper which is supported. [vue-jest]: Error while compiling styles: Error: File to import not found or unreadable: D:\workspaces\vue-jest\vue-jest-3.0.4\test\resources\styles\scss\D:\workspaces\vue-jest\vue-jest-3.0.4\test\resources\styles\scss\globals\global-classes-moduleNameMapper.

As you can see, the path is build up in the wrong way.

image

annam002 avatar Jun 17 '19 12:06 annam002

  1. Can you provide a GitHub repo wit a reproduction?
  2. Do you see this issue in the 4.x beta? (npm install --save-dev vue-jest@beta)

eddyerburgh avatar Sep 08 '19 06:09 eddyerburgh

  1. I could reproduce it by checking out the v3 branch of vue-jest and running the scss.spec.js test

annam002 avatar Sep 10 '19 11:09 annam002

  1. I cannot get a test to run in my project with the 4.x beta version. I fails to compile the Vue template. So, not sure if the situation would be improved with this version.

annam002 avatar Sep 10 '19 11:09 annam002