Skip to content

Commit

Permalink
Chore: fix canvas test runner (#23336)
Browse files Browse the repository at this point in the history
Blocked by #23342

This fixes the local test runner in Canvas. It should not affect anything else, including the CI test runner.

- Bumps JSDOM to ^12.0.0
  - I matched Kibana's version on migration, but nothing else in X-Pack uses JSDOM, so we can use the newer version (which has a very different API)
  - I had to match it because of a script that enforces version matching, but #23342 removed jsdom from Kibana, so we no longer have a version to match
- Restores the local `.babelrc` file
  - I thought it was only used for building plugins; I was wrong 😢
  • Loading branch information
w33ble authored and chrisronline committed Sep 21, 2018
1 parent 0cc2b61 commit 54ba953
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 99 deletions.
2 changes: 1 addition & 1 deletion x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"jest": "^23.5.0",
"jest-cli": "^23.5.0",
"jest-styled-components": "^6.1.1",
"jsdom": "9.9.1",
"jsdom": "^12.0.0",
"mocha": "3.3.0",
"mustache": "^2.3.0",
"mutation-observer": "^1.0.3",
Expand Down
18 changes: 18 additions & 0 deletions x-pack/plugins/canvas/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"plugins": [
"transform-object-rest-spread",
"transform-async-to-generator",
"transform-class-properties"
],
"presets": [
"react",
[
"env",
{
"targets": {
"node": "current"
}
}
]
]
}
1 change: 1 addition & 0 deletions x-pack/plugins/canvas/tasks/helpers/dom_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const { window } = new JSDOM('', {
url: `http://localhost:5601/${basename}`,
pretendToBeVisual: true,
});

global.window = window;
global.document = window.document;
global.navigator = window.navigator;
Expand Down
Loading

0 comments on commit 54ba953

Please sign in to comment.