If I prepend (using prepend option in jest-css-modules-transform-config.js) a .scss file into which I import some variables from different folder (using relative path), my test ends up with an error:
FAIL tests/js/Footer/Footer.test.jsx
● Test suite failed to run
File to import not found or unreadable: ../../styles/colors.
at Object.module.exports.renderSync (node_modules/node-sass/lib/index.js:441:16)
at getSassContent (node_modules/jest-css-modules-transform/dist/index.js:69:24)
at Object.process (node_modules/jest-css-modules-transform/dist/index.js:108:27)
The prepended file (colors.scss) is really simple (as is my config file). Its content is:
/* This theme currently imports dev styles. */
@import '../../styles/colors';
And my jest-css-modules-transform-config.js's content is:
module.exports = {
prepend: ["./assets/themes/orange/colors.scss"]
};
Paths are correct since they work well with sass-resources-loader in my webpack, only the secondary import fails. This still could be my fault as I might be missing some sass configuration in the config file, but I am not sure at this point.
If I prepend (using prepend option in
jest-css-modules-transform-config.js) a.scssfile into which I import some variables from different folder (using relative path), my test ends up with an error:The prepended file (
colors.scss) is really simple (as is my config file). Its content is:And my
jest-css-modules-transform-config.js's content is:Paths are correct since they work well with
sass-resources-loaderin my webpack, only the secondary import fails. This still could be my fault as I might be missing some sass configuration in the config file, but I am not sure at this point.