disable test ignore due codecov problems
This commit is contained in:
50
dist/test-setup/jest-setup.js
vendored
Normal file
50
dist/test-setup/jest-setup.js
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
// JSHint options
|
||||
/* globals global: false */
|
||||
|
||||
import {JSDOM} from 'jsdom';
|
||||
|
||||
// Mock Grafana modules that are not available outside of the core project
|
||||
// Required for loading module.js
|
||||
jest.mock('angular', () => {
|
||||
return {
|
||||
module: function() {
|
||||
return {
|
||||
directive: function() {},
|
||||
service: function() {},
|
||||
factory: function() {}
|
||||
};
|
||||
}
|
||||
};
|
||||
}, {virtual: true});
|
||||
|
||||
jest.mock('app/plugins/sdk', () => {
|
||||
return {
|
||||
QueryCtrl: null
|
||||
};
|
||||
}, {virtual: true});
|
||||
|
||||
jest.mock('app/core/utils/datemath', () => {
|
||||
const datemath = require('./modules/datemath');
|
||||
return {
|
||||
parse: datemath.parse,
|
||||
parseDateMath: datemath.parseDateMath,
|
||||
isValid: datemath.isValid
|
||||
};
|
||||
}, {virtual: true});
|
||||
|
||||
jest.mock('app/core/table_model', () => {
|
||||
return {};
|
||||
}, {virtual: true});
|
||||
|
||||
jest.mock('./css/query-editor.css!', () => {
|
||||
return "";
|
||||
}, {virtual: true});
|
||||
|
||||
jest.mock('jquery', () => 'module not found', {virtual: true});
|
||||
|
||||
// Required for loading angularjs
|
||||
let dom = new JSDOM('<html><head><script></script></head><body></body></html>');
|
||||
// Setup jsdom
|
||||
global.window = dom.window;
|
||||
global.document = global.window.document;
|
||||
global.Node = window.Node;
|
||||
Reference in New Issue
Block a user