Skip to content

Commit

Permalink
Merge branch 'main' into minimum-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Sep 19, 2023
2 parents 08810ec + 180bc8b commit e4145f7
Show file tree
Hide file tree
Showing 35 changed files with 123 additions and 207 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
### Features

- `[jest-environment-jsdom]` [**BREAKING**] Upgrade JSDOM to v22 ([#13825](https://github.com/jestjs/jest/pull/13825))
- `[@jest/fake-timers]` [**BREAKING**] Upgrade `@sinonjs/fake-timers` to v11 ([#14544](https://github.com/jestjs/jest/pull/14544))
- `[@jest/test-sequencer, jest-core]` [**BREAKING**] Exposes `globalConfig` & `contexts` to `TestSequencer` ([#14535](https://github.com/jestjs/jest/pull/14535), & [#14543](https://github.com/jestjs/jest/pull/14543))
- `[pretty-format]` [**BREAKING**] Do not render empty string children (`''`) in React plugin ([#14470](https://github.com/facebook/jest/pull/14470))

### Fixes

Expand All @@ -15,6 +17,7 @@

- `[*]` [**BREAKING**] Drop support for Node.js versions 14 and 19 ([#14460](https://github.com/jestjs/jest/pull/14460))
- `[*]` [**BREAKING**] Drop support for `[email protected]`, minimum version is now `5.0` ([#14542](https://github.com/facebook/jest/pull/14542), [#12648](https://github.com/facebook/jest/pull/12648))
- `[jest-cli, jest-config, @jest/types]` [**BREAKING**] Remove deprecated `--init` argument ([#14490](https://github.com/jestjs/jest/pull/14490))

## 29.7.0

Expand Down
4 changes: 0 additions & 4 deletions constraints.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange2, Depende
DependencyType2 \= 'peerDependencies',
% A list of exception to same version rule
\+ member(DependencyIdent, [
% Allow enzyme example workspace use a older version react and react-dom, because enzyme don't support react 17
'react', 'react-dom', '@types/react',
% Only RN should be bumped to react 18
'react-test-renderer',
% @types/node in the root need to stay on ~14.14.45
'@types/node',
% upgrading the entire repository is a breaking change
Expand Down
4 changes: 0 additions & 4 deletions docs/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,6 @@ Show the help information, similar to this page.

Ignore the tests of the specified projects. Jest uses the attribute `displayName` in the configuration to identify each project. If you use this option, you should provide a `displayName` to all your projects.

### `--init`

Generate a basic configuration file. Based on your project, Jest will ask you a few questions that will help to generate a `jest.config.js` file with a short description for each option.

### `--injectGlobals`

Insert Jest's globals (`expect`, `test`, `describe`, `beforeEach` etc.) into the global environment. If you set this to `false`, you should import from `@jest/globals`, e.g.
Expand Down
2 changes: 1 addition & 1 deletion e2e/babel-plugin-jest-hoist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"@babel/preset-env": "^7.0.0",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-typescript": "^7.0.0",
"react": "17.0.2"
"react": "18.2.0"
},
"jest": {
"automock": true,
Expand Down
18 changes: 5 additions & 13 deletions e2e/babel-plugin-jest-hoist/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1573,13 +1573,6 @@ __metadata:
languageName: node
linkType: hard

"object-assign@npm:^4.1.1":
version: 4.1.1
resolution: "object-assign@npm:4.1.1"
checksum: fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f
languageName: node
linkType: hard

"path-parse@npm:^1.0.7":
version: 1.0.7
resolution: "path-parse@npm:1.0.7"
Expand All @@ -1594,13 +1587,12 @@ __metadata:
languageName: node
linkType: hard

"react@npm:17.0.2":
version: 17.0.2
resolution: "react@npm:17.0.2"
"react@npm:18.2.0":
version: 18.2.0
resolution: "react@npm:18.2.0"
dependencies:
loose-envify: ^1.1.0
object-assign: ^4.1.1
checksum: b254cc17ce3011788330f7bbf383ab653c6848902d7936a87b09d835d091e3f295f7e9dd1597c6daac5dc80f90e778c8230218ba8ad599f74adcc11e33b9d61b
checksum: 88e38092da8839b830cda6feef2e8505dec8ace60579e46aa5490fc3dc9bba0bd50336507dc166f43e3afc1c42939c09fe33b25fae889d6f402721dcd78fca1b
languageName: node
linkType: hard

Expand Down Expand Up @@ -1694,7 +1686,7 @@ __metadata:
"@babel/preset-env": ^7.0.0
"@babel/preset-flow": ^7.0.0
"@babel/preset-typescript": ^7.0.0
react: 17.0.2
react: 18.2.0
languageName: unknown
linkType: soft

Expand Down
6 changes: 3 additions & 3 deletions e2e/transform/multiple-transformers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"react": "17.0.2",
"react-dom": "^17.0.1",
"react-test-renderer": "17.0.2"
"react": "18.2.0",
"react-dom": "18.2.0",
"react-test-renderer": "18.2.0"
}
}
65 changes: 27 additions & 38 deletions e2e/transform/multiple-transformers/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1738,34 +1738,26 @@ __metadata:
languageName: node
linkType: hard

"react-dom@npm:^17.0.1":
version: 17.0.2
resolution: "react-dom@npm:17.0.2"
"react-dom@npm:18.2.0":
version: 18.2.0
resolution: "react-dom@npm:18.2.0"
dependencies:
loose-envify: ^1.1.0
object-assign: ^4.1.1
scheduler: ^0.20.2
scheduler: ^0.23.0
peerDependencies:
react: 17.0.2
checksum: 1c1eaa3bca7c7228d24b70932e3d7c99e70d1d04e13bb0843bbf321582bc25d7961d6b8a6978a58a598af2af496d1cedcfb1bf65f6b0960a0a8161cb8dab743c
react: ^18.2.0
checksum: 7d323310bea3a91be2965f9468d552f201b1c27891e45ddc2d6b8f717680c95a75ae0bc1e3f5cf41472446a2589a75aed4483aee8169287909fcd59ad149e8cc
languageName: node
linkType: hard

"react-is@npm:^16.12.0 || ^17.0.0 || ^18.0.0":
"react-is@npm:^16.12.0 || ^17.0.0 || ^18.0.0, react-is@npm:^18.2.0":
version: 18.2.0
resolution: "react-is@npm:18.2.0"
checksum: e72d0ba81b5922759e4aff17e0252bd29988f9642ed817f56b25a3e217e13eea8a7f2322af99a06edb779da12d5d636e9fda473d620df9a3da0df2a74141d53e
languageName: node
linkType: hard

"react-is@npm:^17.0.2":
version: 17.0.2
resolution: "react-is@npm:17.0.2"
checksum: 9d6d111d8990dc98bc5402c1266a808b0459b5d54830bbea24c12d908b536df7883f268a7868cfaedde3dd9d4e0d574db456f84d2e6df9c4526f99bb4b5344d8
languageName: node
linkType: hard

"react-shallow-renderer@npm:^16.13.1":
"react-shallow-renderer@npm:^16.15.0":
version: 16.15.0
resolution: "react-shallow-renderer@npm:16.15.0"
dependencies:
Expand All @@ -1777,27 +1769,25 @@ __metadata:
languageName: node
linkType: hard

"react-test-renderer@npm:17.0.2":
version: 17.0.2
resolution: "react-test-renderer@npm:17.0.2"
"react-test-renderer@npm:18.2.0":
version: 18.2.0
resolution: "react-test-renderer@npm:18.2.0"
dependencies:
object-assign: ^4.1.1
react-is: ^17.0.2
react-shallow-renderer: ^16.13.1
scheduler: ^0.20.2
react-is: ^18.2.0
react-shallow-renderer: ^16.15.0
scheduler: ^0.23.0
peerDependencies:
react: 17.0.2
checksum: e6b5c6ed2a0bde2c34f1ab9523ff9bc4c141a271daf730d6b852374e83acc0155d58ab71a318251e953ebfa65b8bebb9c5dce3eba1ccfcbef7cc4e1e8261c401
react: ^18.2.0
checksum: 6b6980ced93fa2b72662d5e4ab3b4896833586940047ce52ca9aca801e5432adf05fcbe28289b0af3ce6a2a7c590974e25dcc8aa43d0de658bfe8bbcd686f958
languageName: node
linkType: hard

"react@npm:17.0.2":
version: 17.0.2
resolution: "react@npm:17.0.2"
"react@npm:18.2.0":
version: 18.2.0
resolution: "react@npm:18.2.0"
dependencies:
loose-envify: ^1.1.0
object-assign: ^4.1.1
checksum: b254cc17ce3011788330f7bbf383ab653c6848902d7936a87b09d835d091e3f295f7e9dd1597c6daac5dc80f90e778c8230218ba8ad599f74adcc11e33b9d61b
checksum: 88e38092da8839b830cda6feef2e8505dec8ace60579e46aa5490fc3dc9bba0bd50336507dc166f43e3afc1c42939c09fe33b25fae889d6f402721dcd78fca1b
languageName: node
linkType: hard

Expand Down Expand Up @@ -1891,19 +1881,18 @@ __metadata:
"@babel/core": ^7.0.0
"@babel/preset-env": ^7.0.0
"@babel/preset-react": ^7.0.0
react: 17.0.2
react-dom: ^17.0.1
react-test-renderer: 17.0.2
react: 18.2.0
react-dom: 18.2.0
react-test-renderer: 18.2.0
languageName: unknown
linkType: soft

"scheduler@npm:^0.20.2":
version: 0.20.2
resolution: "scheduler@npm:0.20.2"
"scheduler@npm:^0.23.0":
version: 0.23.0
resolution: "scheduler@npm:0.23.0"
dependencies:
loose-envify: ^1.1.0
object-assign: ^4.1.1
checksum: c4b35cf967c8f0d3e65753252d0f260271f81a81e427241295c5a7b783abf4ea9e905f22f815ab66676f5313be0a25f47be582254db8f9241b259213e999b8fc
checksum: d79192eeaa12abef860c195ea45d37cbf2bbf5f66e3c4dcd16f54a7da53b17788a70d109ee3d3dde1a0fd50e6a8fc171f4300356c5aee4fc0171de526bf35f8a
languageName: node
linkType: hard

Expand Down
2 changes: 1 addition & 1 deletion examples/react-testing-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "example-react-testing-library",
"dependencies": {
"react": "18.2.0",
"react-dom": "^18.2.0"
"react-dom": "18.2.0"
},
"devDependencies": {
"@babel/core": "^7.11.6",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "example-react",
"dependencies": {
"react": "18.2.0",
"react-dom": "^18.2.0"
"react-dom": "18.2.0"
},
"devDependencies": {
"@babel/core": "^7.11.6",
Expand Down
4 changes: 2 additions & 2 deletions examples/snapshot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "0.0.0",
"name": "example-snapshot",
"dependencies": {
"react": "17.0.2"
"react": "18.2.0"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.12.1",
"babel-jest": "workspace:^",
"jest": "workspace:^",
"react-test-renderer": "17.0.2"
"react-test-renderer": "18.2.0"
},
"scripts": {
"test": "jest"
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "example-typescript",
"dependencies": {
"react": "18.2.0",
"react-dom": "^18.2.0",
"react-dom": "18.2.0",
"typescript": "^5.0.4"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"jest-changed-files": "workspace:^",
"jest-junit": "^16.0.0",
"jest-mock": "workspace:^",
"jest-runner-tsd": "^5.0.0",
"jest-runner-tsd": "^6.0.0",
"jest-serializer-ansi-escapes": "^2.0.1",
"jest-silent-reporter": "^0.5.0",
"jest-snapshot": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/expect-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@tsd/typescript": "^5.0.4",
"immutable": "^4.0.0",
"jest-matcher-utils": "workspace:^",
"tsd-lite": "^0.7.0"
"tsd-lite": "^0.8.0"
},
"engines": {
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/expect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@tsd/typescript": "^5.0.4",
"chalk": "^4.0.0",
"immutable": "^4.0.0",
"tsd-lite": "^0.7.0"
"tsd-lite": "^0.8.0"
},
"engines": {
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
Expand Down
3 changes: 1 addition & 2 deletions packages/jest-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@jest/test-result": "workspace:^",
"@jest/types": "workspace:^",
"chalk": "^4.0.0",
"create-jest": "workspace:^",
"exit": "^0.1.2",
"import-local": "^3.0.2",
"jest-config": "workspace:^",
Expand All @@ -29,7 +28,7 @@
"@tsd/typescript": "^5.0.4",
"@types/exit": "^0.1.30",
"@types/yargs": "^17.0.8",
"tsd-lite": "^0.7.0"
"tsd-lite": "^0.8.0"
},
"peerDependencies": {
"node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
Expand Down
4 changes: 0 additions & 4 deletions packages/jest-cli/src/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,6 @@ export const options: {[key: string]: Options} = {
string: true,
type: 'array',
},
init: {
description: 'Generate a basic configuration file',
type: 'boolean',
},
injectGlobals: {
description: 'Should Jest inject global variables or not',
type: 'boolean',
Expand Down
7 changes: 0 additions & 7 deletions packages/jest-cli/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import yargs = require('yargs');
import {getVersion, runCLI} from '@jest/core';
import type {AggregatedResult} from '@jest/test-result';
import type {Config} from '@jest/types';
import {runCreate} from 'create-jest';
import {deprecationEntries} from 'jest-config';
import {clearLine, tryRealpath} from 'jest-util';
import {validateCLIOptions} from 'jest-validate';
Expand All @@ -24,12 +23,6 @@ export async function run(
): Promise<void> {
try {
const argv = await buildArgv(maybeArgv);

if (argv.init) {
await runCreate();
return;
}

const projects = getProjectListFromCLIArgs(argv, project);

const {results, globalConfig} = await runCLI(argv, projects);
Expand Down
1 change: 0 additions & 1 deletion packages/jest-cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"include": ["./src/**/*"],
"exclude": ["./**/__tests__/**/*"],
"references": [
{"path": "../create-jest"},
{"path": "../jest-config"},
{"path": "../jest-core"},
{"path": "../jest-test-result"},
Expand Down
5 changes: 5 additions & 0 deletions packages/jest-config/src/Deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ const deprecatedOptions: DeprecatedOptions = {
Please update your configuration.`,

init: () =>
` Option ${chalk.bold(
'"init"',
)} has been deprecated. Please use "create-jest" package as shown in the documentation: https://jestjs.io/docs/getting-started#generate-a-basic-configuration-file`,

moduleLoader: (_options: {moduleLoader?: string}) => ` Option ${chalk.bold(
'"moduleLoader"',
)} was replaced by ${chalk.bold('"runtime"')}.
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-expect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"devDependencies": {
"@tsd/typescript": "^5.0.4",
"tsd-lite": "^0.7.0"
"tsd-lite": "^0.8.0"
},
"engines": {
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-fake-timers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@jest/types": "workspace:^",
"@sinonjs/fake-timers": "^10.0.2",
"@sinonjs/fake-timers": "^11.1.0",
"@types/node": "*",
"jest-message-util": "workspace:^",
"jest-mock": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"devDependencies": {
"@tsd/typescript": "^5.0.4",
"tsd-lite": "^0.7.0"
"tsd-lite": "^0.8.0"
},
"engines": {
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-reporters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"jest-resolve": "workspace:^",
"mock-fs": "^5.1.2",
"node-notifier": "^10.0.0",
"tsd-lite": "^0.7.0"
"tsd-lite": "^0.8.0"
},
"peerDependencies": {
"node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-resolve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/graceful-fs": "^4.1.3",
"@types/pnpapi": "^0.0.2",
"@types/resolve": "^1.20.2",
"tsd-lite": "^0.7.0"
"tsd-lite": "^0.8.0"
},
"engines": {
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
Expand Down
Loading

0 comments on commit e4145f7

Please sign in to comment.