mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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/'],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user