@wordpress/jest-preset-default 7.1.3 → 8.0.1-next.f435e9e01b.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/CHANGELOG.md +11 -0
- package/LICENSE.md +1 -1
- package/README.md +8 -2
- package/jest-preset.js +7 -4
- package/package.json +8 -5
- package/scripts/setup-globals.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 8.0.0 (2022-01-27)
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
- The peer `jest` dependency has been updated from requiring `>=26` to requiring `>=27` (see [Breaking Changes](https://jestjs.io/blog/2021/05/25/jest-27), [#33287](https://github.com/WordPress/gutenberg/pull/33287)).
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
- Allow ESLint to be imported from within Jest (e.g. when using `ruleTester`) ([#36283](https://github.com/WordPress/gutenberg/pull/36283)).
|
|
14
|
+
- Improve support for test files with `.jsx` and `.tsx` extensions ([#36260](https://github.com/WordPress/gutenberg/pull/36260)).
|
|
15
|
+
|
|
5
16
|
## 7.1.2 (2021-10-22)
|
|
6
17
|
|
|
7
18
|
### Bug Fix
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -31,9 +31,15 @@ npm install @wordpress/jest-preset-default --save-dev
|
|
|
31
31
|
- `setupFiles` - runs code before each test which sets up global variables required in the testing environment.
|
|
32
32
|
- `setupFilesAfterEnv` - runs code which adds improved support for `Console` object and `React` components to the testing framework before each test.
|
|
33
33
|
- `snapshotSerializers` - makes it possible to use snapshot tests on `Enzyme` wrappers.
|
|
34
|
-
- `testMatch`- includes `/test/` subfolder in addition to the glob patterns Jest uses to detect test files. It detects only test files containing `.js
|
|
34
|
+
- `testMatch`- includes `/test/` subfolder in addition to the glob patterns Jest uses to detect test files. It detects only test files containing `.js`, `.jsx`, `.ts` and `.tsx` suffix. It doesn't match files with `.spec.js` suffix.
|
|
35
35
|
- `timers` - use of [fake timers](https://jestjs.io/docs/en/timer-mocks.html) for functions such as `setTimeout` is enabled.
|
|
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/jest-preset.js
CHANGED
|
@@ -3,6 +3,8 @@ module.exports = {
|
|
|
3
3
|
'\\.(scss|css)$': require.resolve(
|
|
4
4
|
'@wordpress/jest-preset-default/scripts/style-mock.js'
|
|
5
5
|
),
|
|
6
|
+
// See https://github.com/facebook/jest/issues/11100#issuecomment-967161978
|
|
7
|
+
'@eslint/eslintrc': '@eslint/eslintrc/dist/eslintrc-universal.cjs',
|
|
6
8
|
},
|
|
7
9
|
modulePaths: [ '<rootDir>' ],
|
|
8
10
|
setupFiles: [
|
|
@@ -16,14 +18,15 @@ module.exports = {
|
|
|
16
18
|
),
|
|
17
19
|
],
|
|
18
20
|
snapshotSerializers: [ require.resolve( 'enzyme-to-json/serializer.js' ) ],
|
|
21
|
+
testEnvironment: 'jsdom',
|
|
19
22
|
testMatch: [
|
|
20
|
-
'**/__tests__/**/*.[jt]s',
|
|
21
|
-
'**/test/*.[jt]s',
|
|
22
|
-
'**/?(*.)test.[jt]s',
|
|
23
|
+
'**/__tests__/**/*.[jt]s?(x)',
|
|
24
|
+
'**/test/*.[jt]s?(x)',
|
|
25
|
+
'**/?(*.)test.[jt]s?(x)',
|
|
23
26
|
],
|
|
24
27
|
testPathIgnorePatterns: [ '/node_modules/', '<rootDir>/vendor/' ],
|
|
25
28
|
timers: 'fake',
|
|
26
29
|
transform: {
|
|
27
|
-
'
|
|
30
|
+
'\\.[jt]sx?$': require.resolve( 'babel-jest' ),
|
|
28
31
|
},
|
|
29
32
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/jest-preset-default",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.1-next.f435e9e01b.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,16 +32,19 @@
|
|
|
32
32
|
"main": "index.js",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",
|
|
35
|
-
"@wordpress/jest-console": "^
|
|
36
|
-
"babel-jest": "^
|
|
35
|
+
"@wordpress/jest-console": "^5.0.1-next.f435e9e01b.0",
|
|
36
|
+
"babel-jest": "^27.4.5",
|
|
37
37
|
"enzyme": "^3.11.0",
|
|
38
38
|
"enzyme-to-json": "^3.4.4"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"
|
|
41
|
+
"@babel/core": ">=7",
|
|
42
|
+
"jest": ">=27",
|
|
43
|
+
"react": "^17.0.0",
|
|
44
|
+
"react-dom": "^17.0.0"
|
|
42
45
|
},
|
|
43
46
|
"publishConfig": {
|
|
44
47
|
"access": "public"
|
|
45
48
|
},
|
|
46
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "14b2846015dfb1b440ce93accdd03842ebe5f1cd"
|
|
47
50
|
}
|
package/scripts/setup-globals.js
CHANGED