Fixed Jest errors occurring after latest merge from upstream

This commit is contained in:
gianantoniopini
2021-06-01 12:14:12 +02:00
parent fbe2c1f91c
commit 99f87ebb3e
2 changed files with 5 additions and 2 deletions

View File

@ -2,4 +2,4 @@ const babelOptions = {
presets: ['babel-preset-gatsby'], presets: ['babel-preset-gatsby'],
}; };
module.exports = require('babel-jest').createTransformer(babelOptions); module.exports = require('babel-jest').default.createTransformer(babelOptions);

View File

@ -1,3 +1,5 @@
const esModules = ['gatsby', 'nanoevents'].join('|');
module.exports = { module.exports = {
testRegex: '/*.test.js$', testRegex: '/*.test.js$',
collectCoverage: true, collectCoverage: true,
@ -26,11 +28,12 @@ module.exports = {
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `<rootDir>/__mocks__/file-mock.js`, '.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `<rootDir>/__mocks__/file-mock.js`,
}, },
testPathIgnorePatterns: [`node_modules`, `\\.cache`], testPathIgnorePatterns: [`node_modules`, `\\.cache`],
transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`], transformIgnorePatterns: [`node_modules/(?!${esModules})`],
globals: { globals: {
__PATH_PREFIX__: ``, __PATH_PREFIX__: ``,
}, },
testURL: `http://localhost`, testURL: `http://localhost`,
setupFiles: [`<rootDir>/loadershim.js`], setupFiles: [`<rootDir>/loadershim.js`],
setupFilesAfterEnv: [`<rootDir>/jest.setup.js`], setupFilesAfterEnv: [`<rootDir>/jest.setup.js`],
testEnvironment: 'jsdom',
}; };