Skip to content

Commit 5693212

Browse files
committed
Merge branch 'main' into jsdom-19
2 parents 3c3e216 + a651b65 commit 5693212

File tree

18 files changed

+250
-329
lines changed

18 files changed

+250
-329
lines changed

.eslintplugin/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ exports.rules = {
99
'ban-types-eventually': require('@typescript-eslint/eslint-plugin').rules[
1010
'ban-types'
1111
],
12-
'prefer-rest-params-eventually': require('eslint/lib/rules/prefer-rest-params'),
13-
'prefer-spread-eventually': require('eslint/lib/rules/prefer-spread'),
12+
'prefer-rest-params-eventually':
13+
require('eslint/use-at-your-own-risk').builtinRules.get(
14+
'prefer-rest-params',
15+
),
16+
'prefer-spread-eventually':
17+
require('eslint/use-at-your-own-risk').builtinRules.get('prefer-spread'),
1418
};

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Features
44

55
- `[expect]` [**BREAKING**] Migrate to ESM ([#12344](https://github.com/facebook/jest/pull/12344))
6+
- `[jest-config]` [**BREAKING**] Stop shipping `jest-jasmine2` by default ([#12355](https://github.com/facebook/jest/pull/12355))
67
- `[jest-environment-jsdom]` [**BREAKING**] Upgrade jsdom to 19.0.0 ([#12290](https://github.com/facebook/jest/pull/12290))
78
- `[jest-environment-jsdom]` [**BREAKING**] Add default `browser` condition to `exportConditions` for `jsdom` environment ([#11924](https://github.com/facebook/jest/pull/11924))
89
- `[jest-environment-jsdom]` [**BREAKING**] Migrate to ESM ([#12340](https://github.com/facebook/jest/pull/12340))
@@ -23,7 +24,10 @@
2324
- `[*]` [**BREAKING**] Drop support for `typescript@3.8`, minimum version is now `4.2` ([#11142](https://github.com/facebook/jest/pull/11142))
2425
- `[*]` Bundle all `.d.ts` files into a single `index.d.ts` per module ([#12345](https://github.com/facebook/jest/pull/12345))
2526
- `[expect]` [**BREAKING**] Remove support for importing `build/utils` ([#12323](https://github.com/facebook/jest/pull/12323))
27+
- `[jest-config]` [**BREAKING**] Remove `getTestEnvironment` export ([#12353](https://github.com/facebook/jest/pull/12353))
2628
- `[@jest/core]` Use `index.ts` instead of `jest.ts` as main export ([#12329](https://github.com/facebook/jest/pull/12329))
29+
- `[jest-resolve]` [**BREAKING**] Make `requireResolveFunction` argument mandatory ([#12353](https://github.com/facebook/jest/pull/12353))
30+
- `[jest-runner]` [**BREAKING**] Remove some type exports from `@jest/test-result` ([#12353](https://github.com/facebook/jest/pull/12353))
2731
- `[jest]` Use `index.ts` instead of `jest.ts` as main export ([#12329](https://github.com/facebook/jest/pull/12329))
2832

2933
### Performance

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"@types/jest": "^26.0.15",
2323
"@types/node": "~12.12.0",
2424
"@types/which": "^2.0.0",
25-
"@typescript-eslint/eslint-plugin": "^4.1.0",
26-
"@typescript-eslint/parser": "^4.1.0",
25+
"@typescript-eslint/eslint-plugin": "^5.11.0",
26+
"@typescript-eslint/parser": "^5.11.0",
2727
"ansi-regex": "^5.0.1",
2828
"ansi-styles": "^5.0.0",
2929
"camelcase": "^6.2.0",
@@ -32,15 +32,15 @@
3232
"codecov": "^3.0.0",
3333
"debug": "^4.0.1",
3434
"dedent": "^0.7.0",
35-
"eslint": "^7.7.0",
35+
"eslint": "^8.8.0",
3636
"eslint-config-prettier": "^8.1.0",
3737
"eslint-import-resolver-typescript": "^2.5.0",
3838
"eslint-plugin-eslint-comments": "^3.1.2",
3939
"eslint-plugin-import": "^2.6.0",
40-
"eslint-plugin-jest": "^24.0.0",
40+
"eslint-plugin-jest": "^26.1.0",
4141
"eslint-plugin-local": "^1.0.0",
4242
"eslint-plugin-markdown": "^1.0.0",
43-
"eslint-plugin-prettier": "^3.0.1",
43+
"eslint-plugin-prettier": "^4.0.0",
4444
"execa": "^5.0.0",
4545
"fast-check": "^2.0.0",
4646
"find-process": "^1.4.1",

packages/expect-utils/src/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*
77
*/
88

9-
/* eslint-disable local/ban-types-eventually */
10-
119
import {isPrimitive} from 'jest-get-type';
1210
import {
1311
equals,

packages/expect/src/asymmetricMatchers.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const utils = Object.freeze({
3838
subsetEquality,
3939
});
4040

41-
// eslint-disable-next-line @typescript-eslint/ban-types
4241
function getPrototype(obj: object) {
4342
if (Object.getPrototypeOf) {
4443
return Object.getPrototypeOf(obj);
@@ -51,7 +50,6 @@ function getPrototype(obj: object) {
5150
return obj.constructor.prototype;
5251
}
5352

54-
// eslint-disable-next-line @typescript-eslint/ban-types
5553
export function hasProperty(obj: object | null, property: string): boolean {
5654
if (!obj) {
5755
return false;

packages/jest-config/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"jest-environment-jsdom": "^27.5.1",
3939
"jest-environment-node": "^27.5.1",
4040
"jest-get-type": "^27.5.1",
41-
"jest-jasmine2": "^27.5.1",
4241
"jest-regex-util": "^27.5.1",
4342
"jest-resolve": "^27.5.1",
4443
"jest-runner": "^27.5.1",

packages/jest-config/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import readConfigFileAndSetRootDir from './readConfigFileAndSetRootDir';
1616
import resolveConfigPath from './resolveConfigPath';
1717
import {isJSONString, replaceRootDirInPath} from './utils';
1818

19-
// TODO: remove export in Jest 28
20-
export {resolveTestEnvironment as getTestEnvironment} from 'jest-resolve';
21-
2219
export {isJSONString} from './utils';
2320
export {default as normalize} from './normalize';
2421
export {default as deprecationEntries} from './Deprecated';

packages/jest-config/src/normalize.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,22 @@ export default async function normalize(
626626
if (
627627
!options.testRunner ||
628628
options.testRunner === 'circus' ||
629-
options.testRunner === 'jest-circus'
629+
options.testRunner === 'jest-circus' ||
630+
options.testRunner === 'jest-circus/runner'
630631
) {
631632
options.testRunner = require.resolve('jest-circus/runner');
632633
} else if (options.testRunner === 'jasmine2') {
633-
options.testRunner = require.resolve('jest-jasmine2');
634+
try {
635+
options.testRunner = require.resolve('jest-jasmine2');
636+
} catch (error: any) {
637+
if (error.code === 'MODULE_NOT_FOUND') {
638+
createConfigError(
639+
'jest-jasmine is no longer shipped by default with Jest, you need to install it explicitly or provide an absolute path to Jest',
640+
);
641+
}
642+
643+
throw error;
644+
}
634645
}
635646

636647
if (!options.coverageDirectory) {

packages/jest-config/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"include": ["./src/**/*"],
88
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
9-
// TODO: This is missing `babel-jest`, `jest-jasmine2`, `jest-circus` and
9+
// TODO: This is missing `babel-jest`, `jest-circus` and
1010
// jest-test-sequencer, but that is just `require.resolve`d, so no real use
1111
// for their types
1212
"references": [

packages/jest-jasmine2/src/jasmine/Suite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2929
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3030
*/
3131

32-
/* eslint-disable local/ban-types-eventually, sort-keys, local/prefer-spread-eventually, local/prefer-rest-params-eventually */
32+
/* eslint-disable sort-keys, local/prefer-spread-eventually, local/prefer-rest-params-eventually */
3333

3434
import type {Config} from '@jest/types';
3535
import {convertDescriptorToString} from 'jest-util';

0 commit comments

Comments
 (0)