|
|
@ -1,25 +1,31 @@ |
|
|
|
const esModules = ['react-colorful', 'uuid', 'ol'].join('|'); |
|
|
|
/* |
|
|
|
|
|
|
|
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* In order to extend the configuration follow the steps in .config/README.md |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
module.exports = { |
|
|
|
module.exports = { |
|
|
|
testEnvironment: 'jsdom', |
|
|
|
testEnvironment: 'jest-environment-jsdom', |
|
|
|
|
|
|
|
testMatch: [ |
|
|
|
moduleDirectories: ['node_modules', 'src'], |
|
|
|
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}', |
|
|
|
moduleFileExtensions: ['ts', 'tsx', 'js'], |
|
|
|
'<rootDir>/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}', |
|
|
|
|
|
|
|
'<rootDir>/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}', |
|
|
|
transformIgnorePatterns: [`/node_modules/(?!${esModules})`], |
|
|
|
], |
|
|
|
|
|
|
|
transform: { |
|
|
|
moduleNameMapper: { |
|
|
|
'^.+\\.(t|j)sx?$': [ |
|
|
|
'grafana/app/(.*)': '<rootDir>/src/jest/grafanaMock.ts', |
|
|
|
'@swc/jest', |
|
|
|
'jest/matchMedia': '<rootDir>/src/jest/matchMedia.ts', |
|
|
|
{ |
|
|
|
'jest/outgoingWebhooksStub': '<rootDir>/src/jest/outgoingWebhooksStub.ts', |
|
|
|
sourceMaps: true, |
|
|
|
'^jest$': '<rootDir>/src/jest', |
|
|
|
jsc: { |
|
|
|
'^.+\\.(css|scss)$': '<rootDir>/src/jest/styleMock.ts', |
|
|
|
parser: { |
|
|
|
'^lodash-es$': 'lodash', |
|
|
|
syntax: 'typescript', |
|
|
|
'^.+\\.svg$': '<rootDir>/src/jest/svgTransform.ts', |
|
|
|
tsx: true, |
|
|
|
'^.+\\.png$': '<rootDir>/src/jest/grafanaMock.ts', |
|
|
|
decorators: false, |
|
|
|
|
|
|
|
dynamicImport: true, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
setupFilesAfterEnv: ['<rootDir>/jest-setup.js'], |
|
|
|
setupFilesAfterEnv: ['<rootDir>/.config/jest.setup.ts'], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
testTimeout: 10000, |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|