|
|
|
@ -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 = { |
|
|
|
|
testEnvironment: 'jsdom', |
|
|
|
|
|
|
|
|
|
moduleDirectories: ['node_modules', 'src'], |
|
|
|
|
moduleFileExtensions: ['ts', 'tsx', 'js'], |
|
|
|
|
|
|
|
|
|
transformIgnorePatterns: [`/node_modules/(?!${esModules})`], |
|
|
|
|
|
|
|
|
|
moduleNameMapper: { |
|
|
|
|
'grafana/app/(.*)': '<rootDir>/src/jest/grafanaMock.ts', |
|
|
|
|
'jest/matchMedia': '<rootDir>/src/jest/matchMedia.ts', |
|
|
|
|
'jest/outgoingWebhooksStub': '<rootDir>/src/jest/outgoingWebhooksStub.ts', |
|
|
|
|
'^jest$': '<rootDir>/src/jest', |
|
|
|
|
'^.+\\.(css|scss)$': '<rootDir>/src/jest/styleMock.ts', |
|
|
|
|
'^lodash-es$': 'lodash', |
|
|
|
|
'^.+\\.svg$': '<rootDir>/src/jest/svgTransform.ts', |
|
|
|
|
'^.+\\.png$': '<rootDir>/src/jest/grafanaMock.ts', |
|
|
|
|
testEnvironment: 'jest-environment-jsdom', |
|
|
|
|
testMatch: [ |
|
|
|
|
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}', |
|
|
|
|
'<rootDir>/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}', |
|
|
|
|
'<rootDir>/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}', |
|
|
|
|
], |
|
|
|
|
transform: { |
|
|
|
|
'^.+\\.(t|j)sx?$': [ |
|
|
|
|
'@swc/jest', |
|
|
|
|
{ |
|
|
|
|
sourceMaps: true, |
|
|
|
|
jsc: { |
|
|
|
|
parser: { |
|
|
|
|
syntax: 'typescript', |
|
|
|
|
tsx: true, |
|
|
|
|
decorators: false, |
|
|
|
|
dynamicImport: true, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setupFilesAfterEnv: ['<rootDir>/.config/jest.setup.ts'], |
|
|
|
|
|
|
|
|
|
testTimeout: 10000, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
setupFilesAfterEnv: ['<rootDir>/jest-setup.js'], |
|
|
|
|
}; |
|
|
|
|