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 918f823
Showing 1 changed file with 4 additions and 3 deletions.
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 918f823

Please sign in to comment.