Chore: Upgrade to jest 28 (#49679)

* bump packages to jest 28

* changes needed for jest 28

* map react-colorful as well

* use customResolver and fix last test

* don't need react-colorful installed if we're using a custom resolver

* return correct thing in mock

* remove watchPathIgnorePatterns since we don't have node_modules anymore
This commit is contained in:
Ashley Harrison
2022-05-30 14:14:34 +01:00
committed by GitHub
parent 0a23299878
commit 216565aa00
10 changed files with 1255 additions and 75 deletions

View File

@@ -12,12 +12,13 @@ module.exports = {
transformIgnorePatterns: [
'node_modules/(?!(ol)/)', // <- exclude the open layers library
],
moduleDirectories: ['node_modules', 'public'],
moduleDirectories: ['public'],
roots: ['<rootDir>/public/app', '<rootDir>/public/test', '<rootDir>/packages'],
testRegex: '(\\.|/)(test)\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
setupFiles: ['jest-canvas-mock', './public/test/jest-shim.ts', './public/test/jest-setup.ts'],
testTimeout: 30000,
resolver: `<rootDir>/public/test/jest-resolver.js`,
setupFilesAfterEnv: ['./public/test/setupTests.ts'],
snapshotSerializers: ['enzyme-to-json/serializer'],
globals: {
@@ -37,5 +38,4 @@ module.exports = {
// Because we mock out <Trans /> anyway, we can mock the messages also
'locales/\\w+/messages$': '<rootDir>/public/test/mocks/i18nMessages.ts',
},
watchPathIgnorePatterns: ['<rootDir>/node_modules/'],
};