@wordpress/jest-preset-default 7.1.1-next.253d9b6e21.0 → 7.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/jest-preset.js +0 -1
- package/package.json +3 -3
- package/scripts/setup-globals.js +32 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 7.1.2 (2021-10-22)
|
|
6
|
+
|
|
7
|
+
### Bug Fix
|
|
8
|
+
|
|
9
|
+
- Provide more complete mocks of browser timing functions. ([#35368](https://github.com/WordPress/gutenberg/pull/35368))
|
|
10
|
+
|
|
11
|
+
## 7.1.1 (2021-09-09)
|
|
12
|
+
|
|
13
|
+
### Bug Fix
|
|
14
|
+
|
|
15
|
+
- Restore the default setting for the `verbose` option. In effect, each test won't get reported during the run ([#34327](https://github.com/WordPress/gutenberg/pull/34327)).
|
|
16
|
+
|
|
5
17
|
## 7.0.0 (2021-01-21)
|
|
6
18
|
|
|
7
19
|
### Breaking Changes
|
package/jest-preset.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/jest-preset-default",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.3",
|
|
4
4
|
"description": "Default Jest preset for WordPress development.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"main": "index.js",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",
|
|
35
|
-
"@wordpress/jest-console": "^4.1.1
|
|
35
|
+
"@wordpress/jest-console": "^4.1.1",
|
|
36
36
|
"babel-jest": "^26.6.3",
|
|
37
37
|
"enzyme": "^3.11.0",
|
|
38
38
|
"enzyme-to-json": "^3.4.4"
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "9a1dd3474d937468e4cf9caf9886ad61ef0a8f50"
|
|
47
47
|
}
|
package/scripts/setup-globals.js
CHANGED
|
@@ -5,8 +5,38 @@ global.window.tinyMCEPreInit = {
|
|
|
5
5
|
// <script> tag where it was loaded from, which of course fails here.
|
|
6
6
|
baseURL: 'about:blank',
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
global.window.
|
|
8
|
+
|
|
9
|
+
global.window.requestAnimationFrame = function requestAnimationFrame(
|
|
10
|
+
callback
|
|
11
|
+
) {
|
|
12
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
13
|
+
const randomDelay = Math.round( ( Math.random() * 1_000 ) / 60 );
|
|
14
|
+
|
|
15
|
+
return setTimeout( () => callback( Date.now() ), randomDelay );
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
global.window.cancelAnimationFrame = function cancelAnimationFrame( handle ) {
|
|
19
|
+
return clearTimeout( handle );
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Ignoring `options` argument since we unconditionally schedule this ASAP
|
|
23
|
+
global.window.requestIdleCallback = function requestIdleCallback( callback ) {
|
|
24
|
+
const start = Date.now();
|
|
25
|
+
|
|
26
|
+
return setTimeout(
|
|
27
|
+
() =>
|
|
28
|
+
callback( {
|
|
29
|
+
didTimeout: false,
|
|
30
|
+
timeRemaining: () => Math.max( 0, 50 - ( Date.now() - start ) ),
|
|
31
|
+
} ),
|
|
32
|
+
0
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
global.window.cancelIdleCallback = function cancelIdleCallback( handle ) {
|
|
37
|
+
return clearTimeout( handle );
|
|
38
|
+
};
|
|
39
|
+
|
|
10
40
|
global.window.matchMedia = () => ( {
|
|
11
41
|
matches: false,
|
|
12
42
|
addListener: () => {},
|