Skip to content

Commit 728f112

Browse files
authored
refactor(jest-mock)!: remove MockFunctionMetadataType, MockFunctionMetadata and SpyInstance types (#14621)
1 parent acc0218 commit 728f112

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@
4343
- `[*]` [**BREAKING**] Drop support for `typescript@4.3`, minimum version is now `5.0` ([#14542](https://github.com/facebook/jest/pull/14542))
4444
- `[*]` Depend on exact versions of monorepo dependencies instead of `^` range ([#14553](https://github.com/facebook/jest/pull/14553))
4545
- `[*]` [**BREAKING**] Add ESM wrapper for all of Jest's modules ([#14661](https://github.com/jestjs/jest/pull/14661))
46+
- `[docs]` Fix typos in `CHANGELOG.md` and `packages/jest-validate/README.md` ([#14640](https://github.com/jestjs/jest/pull/14640))
47+
- `[docs]` Don't use alias matchers in docs ([#14631](https://github.com/facebook/jest/pull/14631))
4648
- `[babel-jest, babel-preset-jest]` [**BREAKING**] Increase peer dependency of `@babel/core` to `^7.11` ([#14109](https://github.com/jestjs/jest/pull/14109))
4749
- `[expect]` [**BREAKING**] Remove `.toBeCalled()`, `.toBeCalledTimes()`, `.toBeCalledWith()`, `.lastCalledWith()`, `.nthCalledWith()`, `.toReturn()`, `.toReturnTimes()`, `.toReturnWith()`, `.lastReturnedWith()`, `.nthReturnedWith()` and `.toThrowError()` matcher aliases ([#14632](https://github.com/facebook/jest/pull/14632))
4850
- `[jest-cli, jest-config, @jest/types]` [**BREAKING**] Remove deprecated `--init` argument ([#14490](https://github.com/jestjs/jest/pull/14490))
4951
- `[jest-config, @jest/core, jest-util]` Upgrade `ci-info` ([#14655](https://github.com/jestjs/jest/pull/14655))
52+
- `[jest-mock]` [**BREAKING**] Remove `MockFunctionMetadataType`, `MockFunctionMetadata` and `SpyInstance` types ([#14621](https://github.com/jestjs/jest/pull/14621))
5053
- `[jest-transform]` Upgrade `write-file-atomic` ([#14274](https://github.com/jestjs/jest/pull/14274))
51-
- `[docs]` Fix typos in `CHANGELOG.md` and `packages/jest-validate/README.md` ([#14640](https://github.com/jestjs/jest/pull/14640))
52-
- `[docs]` Don't use alias matchers in docs ([#14631](https://github.com/facebook/jest/pull/14631))
5354

5455
## 29.7.0
5556

packages/jest-mock/src/index.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ export type MockMetadataType =
1919
| 'null'
2020
| 'undefined';
2121

22-
// TODO remove re-export in Jest 30
23-
export type MockFunctionMetadataType = MockMetadataType;
24-
2522
export type MockMetadata<T, MetadataType = MockMetadataType> = {
2623
ref?: number;
2724
members?: Record<string, MockMetadata<T>>;
@@ -33,12 +30,6 @@ export type MockMetadata<T, MetadataType = MockMetadataType> = {
3330
length?: number;
3431
};
3532

36-
// TODO remove re-export in Jest 30
37-
export type MockFunctionMetadata<
38-
T = unknown,
39-
MetadataType = MockMetadataType,
40-
> = MockMetadata<T, MetadataType>;
41-
4233
export type ClassLike = {new (...args: any): any};
4334
export type FunctionLike = (...args: any) => any;
4435

@@ -119,11 +110,6 @@ export type Spied<T extends ClassLike | FunctionLike> = T extends ClassLike
119110
? SpiedFunction<T>
120111
: never;
121112

122-
// TODO in Jest 30 remove `SpyInstance` in favour of `Spied`
123-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
124-
export interface SpyInstance<T extends FunctionLike = UnknownFunction>
125-
extends MockInstance<T> {}
126-
127113
/**
128114
* All what the internal typings need is to be sure that we have any-function.
129115
* `FunctionLike` type ensures that and helps to constrain the type as well.

0 commit comments

Comments
 (0)