Skip to content

Commit

Permalink
feat: stop shipping jasmine by default (#12355)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Feb 10, 2022
1 parent cbc41c2 commit 45f5a43
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
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
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
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
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
Expand Up @@ -12793,7 +12793,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

0 comments on commit 45f5a43

Please sign in to comment.