diff --git a/jest.config.js b/jest.config.js index 63d2702ace7..c73b4f587cc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,12 +1,8 @@ -const esModule = '@iconscout/react-unicons|monaco-editor/esm/vs'; - module.exports = { verbose: false, transform: { '^.+\\.(ts|tsx|js|jsx)$': 'ts-jest', - [`(${esModule}).+\\.js$`]: 'babel-jest', }, - transformIgnorePatterns: [`/node_modules/(?!${esModule})`], moduleDirectories: ['node_modules', 'public'], roots: ['/public/app', '/public/test', '/packages', '/scripts'], testRegex: '(\\.|/)(test)\\.(jsx?|tsx?)$', @@ -18,5 +14,7 @@ module.exports = { moduleNameMapper: { '\\.svg': '/public/test/mocks/svg.ts', '\\.css': '/public/test/mocks/style.ts', + 'monaco-editor/esm/vs/editor/editor.api': '/public/test/mocks/monaco.ts', }, + watchPathIgnorePatterns: ['/node_modules/'], }; diff --git a/package.json b/package.json index 0f5105a4c5c..066aa3b906d 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,6 @@ "@types/tinycolor2": "1.4.2", "@typescript-eslint/eslint-plugin": "3.6.0", "@typescript-eslint/parser": "3.6.0", - "angular-mocks": "1.6.6", "autoprefixer": "9.7.4", "axios": "0.19.2", "babel-core": "7.0.0-bridge.0", diff --git a/public/test/index.ts b/public/test/index.ts deleted file mode 100644 index cc7033d3fa9..00000000000 --- a/public/test/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -import 'jquery'; -import angular from 'angular'; -import 'angular-mocks'; -import 'app/app'; - -// configure enzyme -import Enzyme from 'enzyme'; -import Adapter from 'enzyme-adapter-react-16'; -Enzyme.configure({ adapter: new Adapter() }); - -angular.module('grafana', ['ngRoute']); -angular.module('grafana.services', ['ngRoute', '$strap.directives']); -angular.module('grafana.panels', []); -angular.module('grafana.controllers', []); -angular.module('grafana.directives', []); -angular.module('grafana.filters', []); -angular.module('grafana.routes', ['ngRoute']); - -const context = (require as any).context('../', true, /specs\.(tsx?|js)/); -for (const key of context.keys()) { - context(key); -} diff --git a/public/test/mocks/monaco.ts b/public/test/mocks/monaco.ts new file mode 100644 index 00000000000..2de6c5f4a29 --- /dev/null +++ b/public/test/mocks/monaco.ts @@ -0,0 +1 @@ +export const monaco = 'monaco'; diff --git a/yarn.lock b/yarn.lock index aee5bd68528..d4c4013f540 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7419,11 +7419,6 @@ angular-bindonce@0.3.1: resolved "https://registry.yarnpkg.com/angular-bindonce/-/angular-bindonce-0.3.1.tgz#af19574abd43f608b9236a302cc5ce49d71dc9c6" integrity sha1-rxlXSr1D9gi5I2owLMXOSdcdycY= -angular-mocks@1.6.6: - version "1.6.6" - resolved "https://registry.yarnpkg.com/angular-mocks/-/angular-mocks-1.6.6.tgz#c93018e7838c6dc5ceaf1a6bcf9be13c830ea515" - integrity sha1-yTAY54OMbcXOrxprz5vhPIMOpRU= - angular-native-dragdrop@1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/angular-native-dragdrop/-/angular-native-dragdrop-1.2.2.tgz#d646c6b75b131c48073c3f6e36a225b2726d8bae"