Jest transformer for .scss files.
Allows the :export SCSS statement to be correctly parsed in the Jest tests.
npm i -D jest-scss-export-transform
or
yarn add -D jest-scss-export-transform
or
pnpm i -D jest-scss-export-transform
Using jest.config.js
:
module.exports = {
// A map from regular expressions to paths to transformers
transform: {
'^.+\\.scss$': [
'jest-scss-export-transform',
{
alias: {
'@style': './assets/style',
},
},
],
},
};