From 12ad20499d65c3798fbf0f1453689eaf24959add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Tue, 30 Jul 2019 17:46:47 +0200 Subject: [PATCH] Fix Jest missing webpack config --- tests/js/jest.config.json | 3 +++ tests/js/jestPreprocess.js | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 tests/js/jestPreprocess.js 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 );