Skip to content

Jest transformer for .scss files. Allows the :export SCSS statement to be correctly parsed in the Jest tests.

Notifications You must be signed in to change notification settings

p4trykJ/jest-scss-export-transform

Repository files navigation

jest-scss-export-transform

Jest transformer for .scss files.

Allows the :export SCSS statement to be correctly parsed in the Jest tests.

Install

If your project uses node-sass use v1 and v2 if it uses sass.

npm i -D jest-scss-export-transform

or

yarn add -D jest-scss-export-transform

or

pnpm i -D jest-scss-export-transform

Add to your Jest config

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',
                },
            },
        ],
    },
};

About

Jest transformer for .scss files. Allows the :export SCSS statement to be correctly parsed in the Jest tests.

Resources

Stars

Watchers

Forks

Packages

No packages published