@wordpress/jest-preset-default 7.1.3 → 7.1.5-next.33ec3857e2.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 +7 -0
- package/README.md +1 -1
- package/jest-preset.js +6 -4
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 7.1.4-next.0 (2021-12-20)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- Allow ESLint to be imported from within Jest (e.g. when using `ruleTester`) ([#36283](https://github.com/WordPress/gutenberg/pull/36283)).
|
|
10
|
+
- Improve support for test files with `.jsx` and `.tsx` extensions ([#36260](https://github.com/WordPress/gutenberg/pull/36260)).
|
|
11
|
+
|
|
5
12
|
## 7.1.2 (2021-10-22)
|
|
6
13
|
|
|
7
14
|
### Bug Fix
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ 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.
|
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: [
|
|
@@ -17,13 +19,13 @@ module.exports = {
|
|
|
17
19
|
],
|
|
18
20
|
snapshotSerializers: [ require.resolve( 'enzyme-to-json/serializer.js' ) ],
|
|
19
21
|
testMatch: [
|
|
20
|
-
'**/__tests__/**/*.[jt]s',
|
|
21
|
-
'**/test/*.[jt]s',
|
|
22
|
-
'**/?(*.)test.[jt]s',
|
|
22
|
+
'**/__tests__/**/*.[jt]s?(x)',
|
|
23
|
+
'**/test/*.[jt]s?(x)',
|
|
24
|
+
'**/?(*.)test.[jt]s?(x)',
|
|
23
25
|
],
|
|
24
26
|
testPathIgnorePatterns: [ '/node_modules/', '<rootDir>/vendor/' ],
|
|
25
27
|
timers: 'fake',
|
|
26
28
|
transform: {
|
|
27
|
-
'
|
|
29
|
+
'\\.[jt]sx?$': require.resolve( 'babel-jest' ),
|
|
28
30
|
},
|
|
29
31
|
};
|
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.5-next.33ec3857e2.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,17 @@
|
|
|
32
32
|
"main": "index.js",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",
|
|
35
|
-
"@wordpress/jest-console": "^4.1.
|
|
35
|
+
"@wordpress/jest-console": "^4.1.2-next.33ec3857e2.0",
|
|
36
36
|
"babel-jest": "^26.6.3",
|
|
37
37
|
"enzyme": "^3.11.0",
|
|
38
38
|
"enzyme-to-json": "^3.4.4"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
+
"@babel/core": ">=7",
|
|
41
42
|
"jest": ">=26"
|
|
42
43
|
},
|
|
43
44
|
"publishConfig": {
|
|
44
45
|
"access": "public"
|
|
45
46
|
},
|
|
46
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "51c7917ea7fac72953702f24d6daac87d99e7617"
|
|
47
48
|
}
|