-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Description
We're using CSS modules in our React components, which are importing .scss files, like this:
import styles from './ReviewFeedItem.scss';
To ignore them when running jest, I've excluded /scss/ from the module loader (or so I think):
// package.json
"preprocessorIgnorePatterns": [
"/scss/"
],
However, when running the tests, the module loader still tries (and fails) to parse the .scss file as javascript and yields this error:
Runtime Error
SyntaxError: Unexpected token ILLEGAL in file 'src/components/navigation/Navigation.scss'.
Make sure your preprocessor is set up correctly and ensure your 'preprocessorIgnorePatterns' configuration is correct: http://facebook.github.io/jest/docs/api.html#config-preprocessorignorepatterns-array-string
If you are currently setting up Jest or modifying your preprocessor, try `jest --no-cache`.
Preprocessor: jest-preprocessor.js.
Jest tried to the execute the following preprocessed code:
body { height: 0; }
Any variation of the exclude Pattern, such as \\.scss, scss and so forth has no effect.
We're using babel-jest as the scriptPreprocessor (so no specific entry for that in package.json)
bookman25, richtier, rocksfenix, matthewdavidson, alexduros and 13 more
Metadata
Metadata
Assignees
Labels
No labels