From 6187a17f6d944d1c7b57bb8c3b2ee472fe3cc9ee Mon Sep 17 00:00:00 2001 From: Alexandre Parent Date: Tue, 20 Nov 2018 19:25:52 -0500 Subject: [PATCH] Added a use for expect 'checker' with a callback I often use expect(Object, CallbackHandler) because expect((Response) => any, CallbackHandler) doesn't exist. On the other hand, making callback nullable will allow those using it without callback to keep doing it. --- types/supertest/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/supertest/index.d.ts b/types/supertest/index.d.ts index 77418352f9..5ac03df42d 100644 --- a/types/supertest/index.d.ts +++ b/types/supertest/index.d.ts @@ -24,7 +24,7 @@ declare namespace supertest { serverAddress(app: any, path: string): string; expect(status: number, callback?: CallbackHandler): this; expect(status: number, body: any, callback?: CallbackHandler): this; - expect(checker: (res: Response) => any): this; + expect(checker: (res: Response) => any, callback?: CallbackHandler): this; expect(body: string, callback?: CallbackHandler): this; expect(body: RegExp, callback?: CallbackHandler): this; expect(body: Object, callback?: CallbackHandler): this;