diff --git a/jest.config.js b/jest.config.js index 4ed043f73de..9c991a446fc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -31,7 +31,7 @@ module.exports = { transformIgnorePatterns: [ `/node_modules/(?!${esModules})`, // exclude es modules to prevent TS complaining ], - moduleDirectories: ['public', 'node_modules'], + moduleDirectories: ['public', 'node_modules', 'public/test'], roots: ['/public/app', '/public/test', '/packages', '/scripts/tests'], testRegex: '(\\.|/)(test)\\.(jsx?|tsx?)$', moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], @@ -54,6 +54,7 @@ module.exports = { '^@grafana/schema/dist/esm/(.*)$': '/packages/grafana-schema/src/$1', // prevent systemjs amd extra from breaking tests. 'systemjs/dist/extras/amd': '/public/test/mocks/systemjsAMDExtra.ts', + '@grafana/test-utils': '/public/test/test-utils.tsx', }, // Log the test results with dynamic Loki tags. Drone CI only reporters: ['default', ['/public/test/log-reporter.js', { enable: process.env.DRONE === 'true' }]], diff --git a/tsconfig.json b/tsconfig.json index 4949f581e7a..788431077ee 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,14 +11,15 @@ "incremental": true, "tsBuildInfoFile": "./tsconfig.tsbuildinfo", "paths": { - "@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"] + "@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"], + "@grafana/test-utils": ["./test/test-utils.tsx"] } }, "extends": "@grafana/tsconfig/base.json", "include": [ "public/app/**/*.ts*", "public/e2e-test/**/*.ts", - "public/test/**/*.ts", + "public/test/**/*.ts*", "public/vendor/**/*.ts", "packages/grafana-data/typings", "packages/grafana-ui/src/types"