diff --git a/tests/js/jest.config.json b/tests/js/jest.config.json index b6b42b4b830..797634d908f 100644 --- a/tests/js/jest.config.json +++ b/tests/js/jest.config.json @@ -15,5 +15,8 @@ "node_modules/(?!(simple-html-tokenizer)/)" ], "preset": "@wordpress/jest-preset-default", + "transform": { + "^.+\\.js$": "/tests/js/jestPreprocess.js" + }, "verbose": true } diff --git a/tests/js/jestPreprocess.js b/tests/js/jestPreprocess.js new file mode 100644 index 00000000000..f733f199360 --- /dev/null +++ b/tests/js/jestPreprocess.js @@ -0,0 +1,5 @@ +const babelOptions = { + presets: [ '@wordpress/babel-preset-default' ], +}; + +module.exports = require( 'babel-jest' ).createTransformer( babelOptions );