Skip to content

Commit

Permalink
feat(jest-mock): Export Mock, MockInstance, SpyInstance types
Browse files Browse the repository at this point in the history
  • Loading branch information
anilanar committed Jun 6, 2020
1 parent 068ec04 commit 11a4e2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Features

- `[jest-mock]` Export `Mock`, `MockInstance`, `SpyInstance` types ([#10138](https://github.com/facebook/jest/pull/10138))
- `[jest-config]` Support config files exporting (`async`) `function`s ([#10001](https://github.com/facebook/jest/pull/10001))
- `[jest-cli, jest-core]` Add `--selectProjects` CLI argument to filter test suites by project name ([#8612](https://github.com/facebook/jest/pull/8612))
- `[jest-cli, jest-init]` Add `coverageProvider` to `jest --init` prompts ([#10044](https://github.com/facebook/jest/pull/10044))
Expand Down
7 changes: 4 additions & 3 deletions packages/jest-mock/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,17 @@ type FunctionPropertyNames<T> = {
}[keyof T] &
string;

interface Mock<T, Y extends Array<unknown> = Array<unknown>>
export interface Mock<T, Y extends Array<unknown> = Array<unknown>>
extends Function,
MockInstance<T, Y> {
new (...args: Y): T;
(...args: Y): T;
}

interface SpyInstance<T, Y extends Array<unknown>> extends MockInstance<T, Y> {}
export interface SpyInstance<T, Y extends Array<unknown>>
extends MockInstance<T, Y> {}

interface MockInstance<T, Y extends Array<unknown>> {
export interface MockInstance<T, Y extends Array<unknown>> {
_isMockFunction: true;
_protoImpl: Function;
getMockName(): string;
Expand Down

0 comments on commit 11a4e2f

Please sign in to comment.