Skip to content

Commit

Permalink
Testing: Include element-closest in test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Sep 10, 2018
1 parent cc0ef8b commit 4c6fe51
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/jest-preset-default/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.1.0 (Unreleased)

### New Features

- Browser globals setup now includes polyfill for [`Element#closest`](https://developer.mozilla.org/en-US/docs/Web/API/Element/closest)

## 2.0.0 (2018-07-12)

### Breaking Change
Expand Down
1 change: 1 addition & 0 deletions packages/jest-preset-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"dependencies": {
"@wordpress/jest-console": "file:../jest-console",
"babel-jest": "^23.4.2",
"element-closest": "^2.0.2",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"jest-enzyme": "^6.0.2"
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-preset-default/scripts/setup-globals.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require( 'element-closest' );

// These are necessary to load TinyMCE successfully
global.URL = window.URL;
global.window.tinyMCEPreInit = {
Expand Down

0 comments on commit 4c6fe51

Please sign in to comment.