Simplify import logic for test utils

This commit is contained in:
Tom Ratcliffe 2024-04-15 16:41:52 +01:00 committed by Tom Ratcliffe
parent 488c5b8396
commit 45949e7684
2 changed files with 2 additions and 4 deletions

View File

@ -31,7 +31,7 @@ module.exports = {
transformIgnorePatterns: [
`/node_modules/(?!${esModules})`, // exclude es modules to prevent TS complaining
],
moduleDirectories: ['public', 'node_modules', 'public/test'],
moduleDirectories: ['public', 'node_modules'],
roots: ['<rootDir>/public/app', '<rootDir>/public/test', '<rootDir>/packages', '<rootDir>/scripts/tests'],
testRegex: '(\\.|/)(test)\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
@ -54,7 +54,6 @@ module.exports = {
'^@grafana/schema/dist/esm/(.*)$': '<rootDir>/packages/grafana-schema/src/$1',
// prevent systemjs amd extra from breaking tests.
'systemjs/dist/extras/amd': '<rootDir>/public/test/mocks/systemjsAMDExtra.ts',
'@grafana/test-utils': '<rootDir>/public/test/test-utils.tsx',
},
// Log the test results with dynamic Loki tags. Drone CI only
reporters: ['default', ['<rootDir>/public/test/log-reporter.js', { enable: process.env.DRONE === 'true' }]],

View File

@ -11,8 +11,7 @@
"incremental": true,
"tsBuildInfoFile": "./tsconfig.tsbuildinfo",
"paths": {
"@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"],
"@grafana/test-utils": ["./test/test-utils.tsx"]
"@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"]
}
},
"extends": "@grafana/tsconfig/base.json",