Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #511 from iliocatallo/main
make `thenThrow` and `thenReject` accept values of `any` type
  • Loading branch information
searls committed Mar 28, 2023
2 parents afd97e2 + 7d0176a commit 3c243bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.d.ts
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: Error): TestDouble<T>;
thenThrow<T>(e: any): TestDouble<T>;
thenResolve<T>(first: R, ...args: Array<R>): TestDouble<T>;
thenReject<T>(e: Error): TestDouble<T>;
thenReject<T>(e: any): 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: Error): TestDouble<T>;
thenReject<T>(e: any): TestDouble<T>;
}

export interface TestdoubleConfig {
Expand Down

0 comments on commit 3c243bc

Please sign in to comment.