From f98816ca8c71db078aa77c4f2db4b897f5bc30ff Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sat, 13 Mar 2021 17:46:54 +0100 Subject: [PATCH] test fixes --- package.json | 1 + tests/babel.config.js | 4 ++++ tests/jest.config.js | 3 +++ 3 files changed, 8 insertions(+) create mode 100644 tests/babel.config.js diff --git a/package.json b/package.json index 385679e..5ece20b 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "@testing-library/jest-dom": "^5.11.9", "@testing-library/react": "^11.2.5", "@welldone-software/why-did-you-render": "^6.1.1", + "babel-preset-gatsby": "^1.0.0", "chalk": "^4.1.0", "eslint": "^7.22.0", "eslint-config-prettier": "^8.1.0", diff --git a/tests/babel.config.js b/tests/babel.config.js new file mode 100644 index 0000000..29bbb8e --- /dev/null +++ b/tests/babel.config.js @@ -0,0 +1,4 @@ +// this file only exists for Jest +module.exports = { + presets: ['babel-preset-gatsby'] +} diff --git a/tests/jest.config.js b/tests/jest.config.js index 64d1f14..f91036c 100644 --- a/tests/jest.config.js +++ b/tests/jest.config.js @@ -1,5 +1,8 @@ module.exports = { rootDir: '../', + transform: { + '^.+\\.[jt]sx?$': ['babel-jest', { configFile: './tests/babel.config.js' }] + }, moduleNameMapper: { '.+\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy', '.+\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':