Skip to content

Commit

Permalink
fix tests (add mocks for some grafana modules)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Jul 8, 2019
1 parent bf014b6 commit 7727d86
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test-setup/jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jest.mock('angular', () => {
};
}, {virtual: true});

jest.mock('grafana/app/core/core_module', () => {
return {
directive: function() {},
};
}, {virtual: true});

let mockPanelCtrl = PanelCtrl;
jest.mock('grafana/app/plugins/sdk', () => {
return {
Expand Down Expand Up @@ -62,6 +68,10 @@ jest.mock('grafana/app/core/config', () => {

jest.mock('jquery', () => 'module not found', {virtual: true});

jest.mock('@grafana/ui', () => {
return {};
}, {virtual: true});

// Required for loading angularjs
let dom = new JSDOM('<html><head><script></script></head><body></body></html>');
// Setup jsdom
Expand Down

0 comments on commit 7727d86

Please sign in to comment.