I Have a nextjs app, I want babel customization to run jest suite for testing, however when I configure babel.config.js file jest runs successfuly, but nextjs is also taking the configuration I dont want that, I want nextjs to ignore babel.config.js, How do I do that?
Just create a different filename for tests (like babel.config.test.js
) and make jest use it.
I assume that your jest config inside package.json
// package.json
{
"jest": {
"transform": {
"\\.js$": ["babel-jest", { "configFile": "./babel.config.test.js" }]
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With