I have my own babel plugin mentioned in babel.config.js
and when I change the plugin, jest doesn't pick the updated plugin code and breaks tests. When I run
npx jest --no-cache
, updated changes are picked up.
I do not want to run with --no-cache
everytime I update the plugin.
I am curious to know how jest picks the latest babel plugins, when they are updated in npm artifactory?
I have mentioned my plugin in babel.config.js
as:
module.exports = function (api) {
api.cache(true);
const presets = ["@babel/preset-env", "@babel/preset-react"];
const plugins = [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime",
["module:@babel-plugin-dynamic-import-override", {
options: someOptions
}]
];
return {
presets,
plugins
};
}
Also, what changes do I make to my jest.config.js
to make it pick the latest plugins?