Babel preset for all Jest plugins. This preset is automatically included when using babel-jest.
$ npm install --save-dev babel-preset-jest
babel.config.js
(Recommended)module.exports = {
presets: ['jest'],
};
$ babel script.js --presets jest
require('@babel/core').transform('code', {
presets: ['jest'],
});