disable test ignore due codecov problems
This commit is contained in:
52
dist/test/test-setup/jest-setup.js
vendored
Normal file
52
dist/test/test-setup/jest-setup.js
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
var _jsdom = require('jsdom');
|
||||
|
||||
// Mock Grafana modules that are not available outside of the core project
|
||||
// Required for loading module.js
|
||||
jest.mock('angular', function () {
|
||||
return {
|
||||
module: function module() {
|
||||
return {
|
||||
directive: function directive() {},
|
||||
service: function service() {},
|
||||
factory: function factory() {}
|
||||
};
|
||||
}
|
||||
};
|
||||
}, { virtual: true }); // JSHint options
|
||||
/* globals global: false */
|
||||
|
||||
jest.mock('app/plugins/sdk', function () {
|
||||
return {
|
||||
QueryCtrl: null
|
||||
};
|
||||
}, { virtual: true });
|
||||
|
||||
jest.mock('app/core/utils/datemath', function () {
|
||||
var datemath = require('./modules/datemath');
|
||||
return {
|
||||
parse: datemath.parse,
|
||||
parseDateMath: datemath.parseDateMath,
|
||||
isValid: datemath.isValid
|
||||
};
|
||||
}, { virtual: true });
|
||||
|
||||
jest.mock('app/core/table_model', function () {
|
||||
return {};
|
||||
}, { virtual: true });
|
||||
|
||||
jest.mock('./css/query-editor.css!', function () {
|
||||
return "";
|
||||
}, { virtual: true });
|
||||
|
||||
jest.mock('jquery', function () {
|
||||
return 'module not found';
|
||||
}, { virtual: true });
|
||||
|
||||
// Required for loading angularjs
|
||||
var dom = new _jsdom.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