diff --git a/.eslintignore b/.eslintignore
index 50bc9799b..5cc53cd12 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -3,3 +3,5 @@ node_modules
report/
dist-start/
dist-build/
+dist-storybook/
+coverage/
diff --git a/.gitignore b/.gitignore
index 5ce052b38..0a12c041c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,8 @@ dist-build/
# managed by sku
.prettierrc
+coverage/
+dist-storybook/
dist/
report/
tsconfig.json
diff --git a/.prettierignore b/.prettierignore
index f76215014..40186ef3d 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -2,6 +2,8 @@ dist-build/
dist-start/
# managed by sku
+coverage/
+dist-storybook/
dist/
report/
# end managed by sku
diff --git a/config/babel/babelConfig.js b/config/babel/babelConfig.js
index 55491dd89..57b0df41a 100644
--- a/config/babel/babelConfig.js
+++ b/config/babel/babelConfig.js
@@ -14,6 +14,7 @@ const nodeEnvOptions = {
module.exports = ({ target, lang = 'js' }) => {
const isBrowser = target === 'browser';
+ const isJest = target === 'jest';
const envPresetOptions = isBrowser ? browserEnvOptions : nodeEnvOptions;
const plugins = [
@@ -37,6 +38,10 @@ module.exports = ({ target, lang = 'js' }) => {
plugins.push(require.resolve('babel-plugin-seek-style-guide'));
}
+ if (isJest) {
+ plugins.push(require.resolve('babel-plugin-dynamic-import-node'));
+ }
+
if (process.env.NODE_ENV === 'production') {
plugins.push(
require.resolve('@babel/plugin-transform-react-inline-elements'),
diff --git a/config/jest/jsBabelTransform.js b/config/jest/jsBabelTransform.js
index 3d47caa5f..27ed4fdbc 100644
--- a/config/jest/jsBabelTransform.js
+++ b/config/jest/jsBabelTransform.js
@@ -1,4 +1,4 @@
const babelJest = require('babel-jest');
const babelConfig = require('../babel/babelConfig');
-module.exports = babelJest.createTransformer(babelConfig({ target: 'node' }));
+module.exports = babelJest.createTransformer(babelConfig({ target: 'jest' }));
diff --git a/config/jest/tsBabelTransform.js b/config/jest/tsBabelTransform.js
index bdd590f13..7e81652d8 100644
--- a/config/jest/tsBabelTransform.js
+++ b/config/jest/tsBabelTransform.js
@@ -2,5 +2,5 @@ const babelJest = require('babel-jest');
const babelConfig = require('../babel/babelConfig');
module.exports = babelJest.createTransformer(
- babelConfig({ target: 'node', lang: 'ts' }),
+ babelConfig({ target: 'jest', lang: 'ts' }),
);
diff --git a/package.json b/package.json
index 58e08aca0..f6cdbdf3d 100644
--- a/package.json
+++ b/package.json
@@ -94,6 +94,7 @@
"babel-jest": "^24.0.0",
"babel-loader": "^8.0.4",
"babel-plugin-add-react-displayname": "^0.0.5",
+ "babel-plugin-dynamic-import-node": "^2.2.0",
"babel-plugin-flow-react-proptypes": "^25.0.0",
"babel-plugin-macros": "^2.4.2",
"babel-plugin-module-resolver": "^3.1.1",
@@ -190,6 +191,7 @@
"react-dom": "^16.8.1",
"react-helmet": "^5.2.0",
"react-router-dom": "^4.3.1",
+ "react-testing-library": "^6.0.3",
"renovate-config-seek": "^0.4.0",
"seek-asia-style-guide": "^7.0.0",
"seek-style-guide": "^38.9.2",
diff --git a/test/test-cases/multiple-routes/__snapshots__/multiple-routes.test.js.snap b/test/test-cases/multiple-routes/__snapshots__/multiple-routes.test.js.snap
index adc7ccc56..e6fc5453a 100644
--- a/test/test-cases/multiple-routes/__snapshots__/multiple-routes.test.js.snap
+++ b/test/test-cases/multiple-routes/__snapshots__/multiple-routes.test.js.snap
@@ -19,25 +19,25 @@ SOURCE HTML:
@@ -56,25 +56,25 @@ SOURCE HTML:
@@ -86,21 +86,21 @@ POST HYDRATE DIFFS: NO DIFF
exports[`multiple-routes build should generate the expected files 1`] = `
Object {
- "AsyncComponent-4c9203d1f98425beac91.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
+ "AsyncComponent-0f65c3bbe8687e1eecaf.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
"AsyncComponent.render.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
"handlers-Details-0e82719ea3ab71aafb06.css": ._91MnZhe {
color: #00f;
}
,
- "handlers-Details-86d217a554c320e535d5.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
+ "handlers-Details-4ed8e2ebe22a3b84ecff.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
"handlers-Details.render.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
"handlers-Home-62bf94bf0fd2ba3c2aa2.css": ._1QX0Hyt {
color: red;
}
,
- "handlers-Home-9299312b46da1275b24f.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
+ "handlers-Home-d4afda529b3b1a8b8da7.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
"handlers-Home.render.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
- "main-88a2f689f8c24a805319.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
+ "main-31d5c5a990273252eb27.js": "CONTENTS IGNORED IN SNAPSHOT TEST",
"production/au/details/:id/index.html":
@@ -119,31 +119,31 @@ Object {
@@ -165,31 +165,31 @@ Object {
@@ -214,25 +214,25 @@ Object {
@@ -251,25 +251,25 @@ Object {
@@ -294,31 +294,31 @@ Object {
@@ -340,31 +340,31 @@ Object {
@@ -389,25 +389,25 @@ Object {
@@ -426,33 +426,33 @@ Object {