Skip to content

Commit

Permalink
Merge pull request #523 from jthieman/reject-throw-sequential-return-…
Browse files Browse the repository at this point in the history
…value-types

Fix thenReject and thenThrow types
  • Loading branch information
searls authored Nov 13, 2023
2 parents 102c53c + 3369a0c commit 23b2391
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ export const matchers: Matchers;
export interface Stubber<D, R = D extends object ? Partial<D> : D> {
thenReturn<T>(first: R, ...args: Array<R>): TestDouble<T>;
thenDo<T>(f: Function): TestDouble<T>;
thenThrow<T>(e: any): TestDouble<T>;
thenThrow<T>(first: unknown, ...args: Array<unknown>): TestDouble<T>;
thenResolve<T>(first: R, ...args: Array<R>): TestDouble<T>;
thenReject<T>(e: any): TestDouble<T>;
thenReject<T>(first: unknown, ...args: Array<unknown>): TestDouble<T>;
thenCallback<T>(error: any, data: any): TestDouble<T>;
}

export interface PromiseStubber<P, R = P extends object ? Partial<P> : P> {
thenReturn<T>(first: Promise<R>, ...args: Array<Promise<R>>): TestDouble<T>;
thenResolve<T>(first: R, ...args: Array<R>): TestDouble<T>;
thenDo<T>(f: Function): TestDouble<T>;
thenReject<T>(e: any): TestDouble<T>;
thenReject<T>(first: unknown, ...args: Array<unknown>): TestDouble<T>;
}

export interface TestdoubleConfig {
Expand Down

0 comments on commit 23b2391

Please sign in to comment.