Skip to content

Commit b314b07

Browse files
committed
Run "npx yarn upgrade"
This updates to a more recent version of Jest, which will also bring in jsdom 14+. In turn, this requires further adjustments when overriding methods from "window.location".
1 parent 7a6cb0c commit b314b07

File tree

3 files changed

+4785
-2736
lines changed

3 files changed

+4785
-2736
lines changed

jest.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This file is needed because it is used by vscode and other tools that
2+
// call `jest` directly. However, unless you are doing anything special
3+
// do not edit this file
4+
5+
const standard = require('@grafana/toolkit/src/config/jest.plugin.config');
6+
7+
// This process will use the same config that `yarn test` is using
8+
module.exports = standard.jestConfig();

src/worldmap.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,18 @@ describe('WorldmapFoundation', () => {
602602
});
603603

604604
function setupInteractionMocks() {
605+
/*
606+
* Mock window.location methods.
607+
* https://remarkablemark.org/blog/2018/11/17/mock-window-location/
608+
*/
609+
delete window.location;
610+
// @ts-ignore
611+
window.location = {};
612+
605613
// Setup interaction mock for "window.location.assign".
606-
// https://remarkablemark.org/blog/2018/11/17/mock-window-location/
607614
Object.defineProperty(window.location, 'assign', {
608615
configurable: true,
616+
writable: true,
609617
});
610618
window.location.assign = jest.fn();
611619

0 commit comments

Comments
 (0)