test-main.js 641 B

12345678910111213141516171819202122
  1. import prunk from 'prunk';
  2. import {jsdom} from 'jsdom';
  3. import chai from 'chai';
  4. // Mock Grafana modules that are not available outside of the core project
  5. // Required for loading module.js
  6. prunk.mock('./css/query-editor.css!', 'no css, dude.');
  7. prunk.mock('app/plugins/sdk', {
  8. QueryCtrl: null
  9. });
  10. // Setup jsdom
  11. // Required for loading angularjs
  12. global.document = jsdom('<html><head><script></script></head><body></body></html>');
  13. global.window = global.document.parentWindow;
  14. global.navigator = window.navigator = {};
  15. global.Node = window.Node;
  16. // Setup Chai
  17. chai.should();
  18. global.assert = chai.assert;
  19. global.expect = chai.expect;