Skip to content
Open
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- `[jest-runtime]` Fix issue where user cannot utilize dynamic import despite specifying `--experimental-vm-modules` Node option ([#15842](https://github.com/jestjs/jest/pull/15842))

### Chore & Maintenance

- `[docs]` Update V30 migration guide to notify users on `jest.mock()` work with case-sensitive path ([#15849](https://github.com/jestjs/jest/pull/15849))

## 30.2.0

### Chore & Maintenance
Expand Down
16 changes: 16 additions & 0 deletions docs/UpgradingToJest30.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,22 @@ Some TypeScript types related to mock functions have been removed from the publi

If you were using `jest.SpyInstance` (for instance, to annotate the return of `jest.spyOn`), you should update to using [`jest.Spied`](./MockFunctionAPI.md#jestspiedsource).

### `jest.mock` only works with case-sensitive module path

`jest.mock()` will only work case-sensitive module path from now on. At best, this is an edge case since most users would follow OS filename pattern behavior. We recommend to use correctly named module path to avoid similar breakages in the future.

Old code (Jest 29):

```js
jest.mock('./path/to/FILENAME.js'); // This works EVEN when you only have `filename.js`
```

New code (Jest 30):

```js
jest.mock('./path/to/filename.js'); // This strictly works when you ONLY have `filename.js`
```

## Module & Runtime Changes

### ESM Module Support and Internal Restructuring
Expand Down
16 changes: 16 additions & 0 deletions website/versioned_docs/version-30.0/UpgradingToJest30.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,22 @@ Some TypeScript types related to mock functions have been removed from the publi

If you were using `jest.SpyInstance` (for instance, to annotate the return of `jest.spyOn`), you should update to using [`jest.Spied`](./MockFunctionAPI.md#jestspiedsource).

### `jest.mock` only works with case-sensitive module path

`jest.mock()` will only work case-sensitive module path from now on. At best, this is an edge case since most users would follow OS filename pattern behavior. We recommend to use correctly named module path to avoid similar breakages in the future.

Old code (Jest 29):

```js
jest.mock('./path/to/FILENAME.js'); // This works EVEN when you only have `filename.js`
```

New code (Jest 30):

```js
jest.mock('./path/to/filename.js'); // This strictly works when you ONLY have `filename.js`
```

## Module & Runtime Changes

### ESM Module Support and Internal Restructuring
Expand Down
Loading