fix tests

This commit is contained in:
Alexander Zobnin
2020-05-14 19:02:36 +03:00
parent 5422e24af2
commit b09af3c93a
4 changed files with 28 additions and 7 deletions

View File

@@ -4,6 +4,8 @@
import { JSDOM } from 'jsdom';
import { PanelCtrl, MetricsPanelCtrl } from './panelStub';
console.log = () => {};
// Mock Grafana modules that are not available outside of the core project
// Required for loading module.js
jest.mock('angular', () => {
@@ -18,6 +20,14 @@ jest.mock('angular', () => {
};
}, {virtual: true});
jest.mock('@grafana/runtime', () => {
return {
getBackendSrv: () => ({
datasourceRequest: jest.fn().mockResolvedValue(),
}),
};
}, {virtual: true});
jest.mock('grafana/app/core/core_module', () => {
return {
directive: function() {},