Tests: removes unused stuff and replaces monaco transpile with mock (#27324)

This commit is contained in:
Hugo Häggmark 2020-09-03 08:54:46 +02:00 committed by GitHub
parent febbc60e8b
commit d633cc3c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 32 deletions

View File

@ -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: ['<rootDir>/public/app', '<rootDir>/public/test', '<rootDir>/packages', '<rootDir>/scripts'],
testRegex: '(\\.|/)(test)\\.(jsx?|tsx?)$',
@ -18,5 +14,7 @@ module.exports = {
moduleNameMapper: {
'\\.svg': '<rootDir>/public/test/mocks/svg.ts',
'\\.css': '<rootDir>/public/test/mocks/style.ts',
'monaco-editor/esm/vs/editor/editor.api': '<rootDir>/public/test/mocks/monaco.ts',
},
watchPathIgnorePatterns: ['<rootDir>/node_modules/'],
};

View File

@ -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",

View File

@ -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);
}

View File

@ -0,0 +1 @@
export const monaco = 'monaco';

View File

@ -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"