Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: stop shipping jasmine by default #12355

Merged
merged 1 commit into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Features

- `[expect]` [**BREAKING**] Migrate to ESM ([#12344](https://github.com/facebook/jest/pull/12344))
- `[jest-config]` [**BREAKING**] Stop shipping `jest-jasmine2` by default ([#12355](https://github.com/facebook/jest/pull/12355))
- `[jest-environment-jsdom]` [**BREAKING**] Add default `browser` condition to `exportConditions` for `jsdom` environment ([#11924](https://github.com/facebook/jest/pull/11924))
- `[jest-environment-jsdom]` [**BREAKING**] Migrate to ESM ([#12340](https://github.com/facebook/jest/pull/12340))
- `[jest-environment-node]` [**BREAKING**] Add default `node` and `node-addon` conditions to `exportConditions` for `node` environment ([#11924](https://github.com/facebook/jest/pull/11924))
Expand Down
1 change: 0 additions & 1 deletion packages/jest-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"jest-environment-jsdom": "^27.5.1",
"jest-environment-node": "^27.5.1",
"jest-get-type": "^27.5.1",
"jest-jasmine2": "^27.5.1",
"jest-regex-util": "^27.5.1",
"jest-resolve": "^27.5.1",
"jest-runner": "^27.5.1",
Expand Down
15 changes: 13 additions & 2 deletions packages/jest-config/src/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,11 +626,22 @@ export default async function normalize(
if (
!options.testRunner ||
options.testRunner === 'circus' ||
options.testRunner === 'jest-circus'
options.testRunner === 'jest-circus' ||
options.testRunner === 'jest-circus/runner'
) {
options.testRunner = require.resolve('jest-circus/runner');
} else if (options.testRunner === 'jasmine2') {
options.testRunner = require.resolve('jest-jasmine2');
try {
options.testRunner = require.resolve('jest-jasmine2');
} catch (error: any) {
if (error.code === 'MODULE_NOT_FOUND') {
createConfigError(
'jest-jasmine is no longer shipped by default with Jest, you need to install it explicitly or provide an absolute path to Jest',
);
}

throw error;
}
}

if (!options.coverageDirectory) {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"include": ["./src/**/*"],
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"],
// TODO: This is missing `babel-jest`, `jest-jasmine2`, `jest-circus` and
// TODO: This is missing `babel-jest`, `jest-circus` and
// jest-test-sequencer, but that is just `require.resolve`d, so no real use
// for their types
"references": [
Expand Down
1 change: 0 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12811,7 +12811,6 @@ __metadata:
jest-environment-jsdom: ^27.5.1
jest-environment-node: ^27.5.1
jest-get-type: ^27.5.1
jest-jasmine2: ^27.5.1
jest-regex-util: ^27.5.1
jest-resolve: ^27.5.1
jest-runner: ^27.5.1
Expand Down