@wordpress/jest-preset-default 8.0.0 → 8.0.2-next.a55ed9455a.0
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/README.md +7 -1
- package/package.json +3 -3
- package/scripts/setup-globals.js +4 -4
- package/scripts/setup-test-framework.js +1 -1
package/README.md
CHANGED
|
@@ -36,4 +36,10 @@ npm install @wordpress/jest-preset-default --save-dev
|
|
|
36
36
|
- `transform` - keeps the default [babel-jest](https://github.com/facebook/jest/tree/HEAD/packages/babel-jest) transformer.
|
|
37
37
|
- `verbose` - each individual test won't be reported during the run.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
## Contributing to this package
|
|
40
|
+
|
|
41
|
+
This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.
|
|
42
|
+
|
|
43
|
+
To find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).
|
|
44
|
+
|
|
45
|
+
<br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/jest-preset-default",
|
|
3
|
-
"version": "8.0.0",
|
|
3
|
+
"version": "8.0.2-next.a55ed9455a.0",
|
|
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": "^5.0.0",
|
|
35
|
+
"@wordpress/jest-console": "^5.0.2-next.a55ed9455a.0",
|
|
36
36
|
"babel-jest": "^27.4.5",
|
|
37
37
|
"enzyme": "^3.11.0",
|
|
38
38
|
"enzyme-to-json": "^3.4.4"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "c5108185851b824d531bce55991a3589947e8551"
|
|
50
50
|
}
|
package/scripts/setup-globals.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// These are necessary to load TinyMCE successfully
|
|
1
|
+
// These are necessary to load TinyMCE successfully.
|
|
2
2
|
global.URL = window.URL;
|
|
3
3
|
global.window.tinyMCEPreInit = {
|
|
4
4
|
// Without this, TinyMCE tries to determine its URL by looking at the
|
|
@@ -23,7 +23,7 @@ global.window.cancelAnimationFrame = function cancelAnimationFrame( handle ) {
|
|
|
23
23
|
return clearTimeout( handle );
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
// Ignoring `options` argument since we unconditionally schedule this ASAP
|
|
26
|
+
// Ignoring `options` argument since we unconditionally schedule this ASAP.
|
|
27
27
|
global.window.requestIdleCallback = function requestIdleCallback( callback ) {
|
|
28
28
|
const start = Date.now();
|
|
29
29
|
|
|
@@ -47,12 +47,12 @@ global.window.matchMedia = () => ( {
|
|
|
47
47
|
removeListener: () => {},
|
|
48
48
|
} );
|
|
49
49
|
|
|
50
|
-
// Setup fake localStorage
|
|
50
|
+
// Setup fake localStorage.
|
|
51
51
|
const storage = {};
|
|
52
52
|
global.window.localStorage = {
|
|
53
53
|
getItem: ( key ) => ( key in storage ? storage[ key ] : null ),
|
|
54
54
|
setItem: ( key, value ) => ( storage[ key ] = value ),
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
// UserSettings global
|
|
57
|
+
// UserSettings global.
|
|
58
58
|
global.window.userSettings = { uid: 1 };
|
|
@@ -11,7 +11,7 @@ jest.mock( 'enzyme', () => {
|
|
|
11
11
|
if ( ! mockEnzymeSetup ) {
|
|
12
12
|
mockEnzymeSetup = true;
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// Configure enzyme 3 for React, from docs: http://airbnb.io/enzyme/docs/installation/index.html
|
|
15
15
|
const Adapter = jest.requireActual(
|
|
16
16
|
'@wojtekmaj/enzyme-adapter-react-17'
|
|
17
17
|
);
|