diff --git a/CHANGELOG.md b/CHANGELOG.md index aa86dbf20cb6..5e23fc489f62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ ### Fixes +- `[*]` Replace `exit` with `exit-x` ([#15399](https://github.com/jestjs/jest/pull/15399)) - `[babel-plugin-jest-hoist]` Use `denylist` instead of the deprecated `blacklist` for Babel 8 support ([#14109](https://github.com/jestjs/jest/pull/14109)) - `[babel-plugin-jest-hoist]` Do not rely on buggy Babel behaviour ([#15415](https://github.com/jestjs/jest/pull/15415)) - `[expect]` Check error instance type for `toThrow/toThrowError` ([#14576](https://github.com/jestjs/jest/pull/14576)) diff --git a/packages/create-jest/package.json b/packages/create-jest/package.json index 42342b7b892c..83ffdfe5a503 100644 --- a/packages/create-jest/package.json +++ b/packages/create-jest/package.json @@ -24,7 +24,7 @@ "dependencies": { "@jest/types": "workspace:*", "chalk": "^4.0.0", - "exit": "^0.1.2", + "exit-x": "^0.2.2", "graceful-fs": "^4.2.9", "jest-config": "workspace:*", "jest-util": "workspace:*", @@ -37,7 +37,6 @@ "access": "public" }, "devDependencies": { - "@types/exit": "^0.1.30", "@types/graceful-fs": "^4.1.3", "@types/prompts": "^2.0.1" } diff --git a/packages/create-jest/src/runCreate.ts b/packages/create-jest/src/runCreate.ts index fcaa3d46a3f1..f544c76c35a0 100644 --- a/packages/create-jest/src/runCreate.ts +++ b/packages/create-jest/src/runCreate.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import chalk = require('chalk'); -import exit = require('exit'); +import exit = require('exit-x'); import * as fs from 'graceful-fs'; import prompts = require('prompts'); import {constants} from 'jest-config'; diff --git a/packages/jest-cli/package.json b/packages/jest-cli/package.json index 62febb8f3fe6..c64c587c2bc8 100644 --- a/packages/jest-cli/package.json +++ b/packages/jest-cli/package.json @@ -19,7 +19,7 @@ "@jest/test-result": "workspace:*", "@jest/types": "workspace:*", "chalk": "^4.0.0", - "exit": "^0.1.2", + "exit-x": "^0.2.2", "import-local": "^3.0.2", "jest-config": "workspace:*", "jest-util": "workspace:*", @@ -27,7 +27,6 @@ "yargs": "^17.3.1" }, "devDependencies": { - "@types/exit": "^0.1.30", "@types/yargs": "^17.0.8" }, "peerDependencies": { diff --git a/packages/jest-cli/src/run.ts b/packages/jest-cli/src/run.ts index b526b03f9f68..fca08629a9a4 100644 --- a/packages/jest-cli/src/run.ts +++ b/packages/jest-cli/src/run.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import chalk = require('chalk'); -import exit = require('exit'); +import exit = require('exit-x'); import yargs = require('yargs'); import {getVersion, runCLI} from '@jest/core'; import type {AggregatedResult} from '@jest/test-result'; diff --git a/packages/jest-core/package.json b/packages/jest-core/package.json index c66b856b159b..d3b973b49c26 100644 --- a/packages/jest-core/package.json +++ b/packages/jest-core/package.json @@ -24,7 +24,7 @@ "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "ci-info": "^4.0.0", - "exit": "^0.1.2", + "exit-x": "^0.2.2", "graceful-fs": "^4.2.9", "jest-changed-files": "workspace:*", "jest-config": "workspace:*", @@ -47,7 +47,6 @@ "devDependencies": { "@jest/test-sequencer": "workspace:*", "@jest/test-utils": "workspace:*", - "@types/exit": "^0.1.30", "@types/graceful-fs": "^4.1.3", "@types/micromatch": "^4.0.7" }, diff --git a/packages/jest-core/src/TestScheduler.ts b/packages/jest-core/src/TestScheduler.ts index 090b650f55a7..11a38233fdd5 100644 --- a/packages/jest-core/src/TestScheduler.ts +++ b/packages/jest-core/src/TestScheduler.ts @@ -7,7 +7,7 @@ import chalk = require('chalk'); import {GITHUB_ACTIONS} from 'ci-info'; -import exit = require('exit'); +import exit = require('exit-x'); import { CoverageReporter, DefaultReporter, diff --git a/packages/jest-core/src/cli/index.ts b/packages/jest-core/src/cli/index.ts index ca35c0556d53..352cdefeb0f0 100644 --- a/packages/jest-core/src/cli/index.ts +++ b/packages/jest-core/src/cli/index.ts @@ -8,7 +8,7 @@ import {performance} from 'perf_hooks'; import type {WriteStream} from 'tty'; import chalk = require('chalk'); -import exit = require('exit'); +import exit = require('exit-x'); import * as fs from 'graceful-fs'; import {CustomConsole} from '@jest/console'; import type {AggregatedResult, TestContext} from '@jest/test-result'; diff --git a/packages/jest-core/src/runJest.ts b/packages/jest-core/src/runJest.ts index fe73415807d2..5f9ed2e06364 100644 --- a/packages/jest-core/src/runJest.ts +++ b/packages/jest-core/src/runJest.ts @@ -9,7 +9,7 @@ import * as path from 'path'; import {performance} from 'perf_hooks'; import type {WriteStream} from 'tty'; import chalk = require('chalk'); -import exit = require('exit'); +import exit = require('exit-x'); import * as fs from 'graceful-fs'; import {CustomConsole} from '@jest/console'; import { diff --git a/packages/jest-core/src/watch.ts b/packages/jest-core/src/watch.ts index a8cc3e1ff769..2f173263f516 100644 --- a/packages/jest-core/src/watch.ts +++ b/packages/jest-core/src/watch.ts @@ -9,7 +9,7 @@ import * as path from 'path'; import type {WriteStream} from 'tty'; import ansiEscapes = require('ansi-escapes'); import chalk = require('chalk'); -import exit = require('exit'); +import exit = require('exit-x'); import slash = require('slash'); import {TestPathPatterns} from '@jest/pattern'; import type {TestContext} from '@jest/test-result'; diff --git a/packages/jest-reporters/package.json b/packages/jest-reporters/package.json index 82b70946c59f..415cf37d6ad7 100644 --- a/packages/jest-reporters/package.json +++ b/packages/jest-reporters/package.json @@ -23,7 +23,7 @@ "@types/node": "*", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", + "exit-x": "^0.2.2", "glob": "^10.3.10", "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", @@ -42,7 +42,6 @@ "devDependencies": { "@jest/pattern": "workspace:*", "@jest/test-utils": "workspace:*", - "@types/exit": "^0.1.30", "@types/graceful-fs": "^4.1.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-lib-instrument": "^1.7.2", diff --git a/packages/jest-reporters/src/CoverageWorker.ts b/packages/jest-reporters/src/CoverageWorker.ts index d37af58662e5..227225b8ef92 100644 --- a/packages/jest-reporters/src/CoverageWorker.ts +++ b/packages/jest-reporters/src/CoverageWorker.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import exit = require('exit'); +import exit = require('exit-x'); import * as fs from 'graceful-fs'; import type {Config} from '@jest/types'; import generateEmptyCoverage, { diff --git a/packages/jest-reporters/src/NotifyReporter.ts b/packages/jest-reporters/src/NotifyReporter.ts index 6f21108dcccc..7345581fd90e 100644 --- a/packages/jest-reporters/src/NotifyReporter.ts +++ b/packages/jest-reporters/src/NotifyReporter.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import * as util from 'util'; -import exit = require('exit'); +import exit = require('exit-x'); import type {AggregatedResult, TestContext} from '@jest/test-result'; import type {Config} from '@jest/types'; import {pluralize} from 'jest-util'; diff --git a/packages/jest-runner/package.json b/packages/jest-runner/package.json index 8ef53bfff624..506c40e29961 100644 --- a/packages/jest-runner/package.json +++ b/packages/jest-runner/package.json @@ -43,7 +43,6 @@ }, "devDependencies": { "@jest/test-utils": "workspace:*", - "@types/exit": "^0.1.30", "@types/graceful-fs": "^4.1.3", "@types/source-map-support": "^0.5.0", "jest-jasmine2": "workspace:*" diff --git a/packages/jest-runner/src/testWorker.ts b/packages/jest-runner/src/testWorker.ts index 83a2589df871..3ca7dbfb662b 100644 --- a/packages/jest-runner/src/testWorker.ts +++ b/packages/jest-runner/src/testWorker.ts @@ -6,7 +6,7 @@ * */ -import exit = require('exit'); +import exit = require('exit-x'); import type { SerializableError, TestFileEvent, diff --git a/yarn.lock b/yarn.lock index fc16700cf887..3b4a3f6e6273 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3125,14 +3125,13 @@ __metadata: "@jest/test-utils": "workspace:*" "@jest/transform": "workspace:*" "@jest/types": "workspace:*" - "@types/exit": ^0.1.30 "@types/graceful-fs": ^4.1.3 "@types/micromatch": ^4.0.7 "@types/node": "*" ansi-escapes: ^4.2.1 chalk: ^4.0.0 ci-info: ^4.0.0 - exit: ^0.1.2 + exit-x: ^0.2.2 graceful-fs: ^4.2.9 jest-changed-files: "workspace:*" jest-config: "workspace:*" @@ -3363,7 +3362,6 @@ __metadata: "@jest/transform": "workspace:*" "@jest/types": "workspace:*" "@jridgewell/trace-mapping": ^0.3.18 - "@types/exit": ^0.1.30 "@types/graceful-fs": ^4.1.3 "@types/istanbul-lib-coverage": ^2.0.0 "@types/istanbul-lib-instrument": ^1.7.2 @@ -3374,7 +3372,7 @@ __metadata: "@types/node-notifier": ^8.0.0 chalk: ^4.0.0 collect-v8-coverage: ^1.0.0 - exit: ^0.1.2 + exit-x: ^0.2.2 glob: ^10.3.10 graceful-fs: ^4.2.9 istanbul-lib-coverage: ^3.0.0 @@ -5415,15 +5413,6 @@ __metadata: languageName: node linkType: hard -"@types/exit@npm:^0.1.30": - version: 0.1.33 - resolution: "@types/exit@npm:0.1.33" - dependencies: - "@types/node": "*" - checksum: 74e8e74ea3ce2c2a0ebc7dbf1ac06a93bc99a073872db203ced3de7b439985a932dce5bc63b6841b21f34929b1e2f5f7db28c11c39fe43c0b09c3d4fb6bb7eec - languageName: node - linkType: hard - "@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^4.17.33": version: 4.19.5 resolution: "@types/express-serve-static-core@npm:4.19.5" @@ -8505,11 +8494,10 @@ __metadata: resolution: "create-jest@workspace:packages/create-jest" dependencies: "@jest/types": "workspace:*" - "@types/exit": ^0.1.30 "@types/graceful-fs": ^4.1.3 "@types/prompts": ^2.0.1 chalk: ^4.0.0 - exit: ^0.1.2 + exit-x: ^0.2.2 graceful-fs: ^4.2.9 jest-config: "workspace:*" jest-util: "workspace:*" @@ -10523,10 +10511,10 @@ __metadata: languageName: node linkType: hard -"exit@npm:^0.1.2": - version: 0.1.2 - resolution: "exit@npm:0.1.2" - checksum: abc407f07a875c3961e4781dfcb743b58d6c93de9ab263f4f8c9d23bb6da5f9b7764fc773f86b43dd88030444d5ab8abcb611cb680fba8ca075362b77114bba3 +"exit-x@npm:^0.2.2": + version: 0.2.2 + resolution: "exit-x@npm:0.2.2" + checksum: c62a8e0f77b1de00059c2976ddb774c41d06969a4262d984a58cd51995be1fc0ce962329ea68722bba0c254adb3930cc3625dabaf079fe8031cd03e91db1ba51 languageName: node linkType: hard @@ -13150,10 +13138,9 @@ __metadata: "@jest/core": "workspace:*" "@jest/test-result": "workspace:*" "@jest/types": "workspace:*" - "@types/exit": ^0.1.30 "@types/yargs": ^17.0.8 chalk: ^4.0.0 - exit: ^0.1.2 + exit-x: ^0.2.2 import-local: ^3.0.2 jest-config: "workspace:*" jest-util: "workspace:*" @@ -13531,7 +13518,6 @@ __metadata: "@jest/test-utils": "workspace:*" "@jest/transform": "workspace:*" "@jest/types": "workspace:*" - "@types/exit": ^0.1.30 "@types/graceful-fs": ^4.1.3 "@types/node": "*" "@types/source-map-support": ^0.5.0