Answers for "how to make jest parse the imported css modules in create react app"

CSS
0

how to make jest parse the imported css modules in create react app

// add a jest.config.js to the project with this content
const config = {
    verbose: true,
    "moduleNameMapper": {
        "\.(scss|less)$": "<rootDir>/config/CSSStub.js"
    }
}

module.exports = config;

// Or async function
module.exports = async() => {
    return {
        verbose: true,
    };
};
Posted by: Guest on January-29-2022

Code answers related to "how to make jest parse the imported css modules in create react app"

Browse Popular Code Answers by Language