Skip to content

Commit 3369a0c

Browse files
committed
fix thenReject and thenThrow types
They should support sequential return values.
1 parent 102c53c commit 3369a0c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ export const matchers: Matchers;
5656
export interface Stubber<D, R = D extends object ? Partial<D> : D> {
5757
thenReturn<T>(first: R, ...args: Array<R>): TestDouble<T>;
5858
thenDo<T>(f: Function): TestDouble<T>;
59-
thenThrow<T>(e: any): TestDouble<T>;
59+
thenThrow<T>(first: unknown, ...args: Array<unknown>): TestDouble<T>;
6060
thenResolve<T>(first: R, ...args: Array<R>): TestDouble<T>;
61-
thenReject<T>(e: any): TestDouble<T>;
61+
thenReject<T>(first: unknown, ...args: Array<unknown>): TestDouble<T>;
6262
thenCallback<T>(error: any, data: any): TestDouble<T>;
6363
}
6464

6565
export interface PromiseStubber<P, R = P extends object ? Partial<P> : P> {
6666
thenReturn<T>(first: Promise<R>, ...args: Array<Promise<R>>): TestDouble<T>;
6767
thenResolve<T>(first: R, ...args: Array<R>): TestDouble<T>;
6868
thenDo<T>(f: Function): TestDouble<T>;
69-
thenReject<T>(e: any): TestDouble<T>;
69+
thenReject<T>(first: unknown, ...args: Array<unknown>): TestDouble<T>;
7070
}
7171

7272
export interface TestdoubleConfig {

0 commit comments

Comments
 (0)