// Type definitions for SuperTest as Promised v2.0.2 // Project: https://github.com/WhoopInc/supertest-as-promised // Definitions by: Tanguy Krotoff // Definitions: https://github.com/borisyankov/DefinitelyTyped /// /// declare module "supertest-as-promised" { // Mostly copy-pasted from supertest.d.ts import * as superagent from 'superagent'; import * as PromiseBluebird from 'bluebird'; function supertest(app: any): supertest.SuperTest; module supertest { function agent(app?: any): supertest.SuperTest; interface SuperTest extends superagent.SuperAgent { } interface Promise extends PromiseBluebird { toPromise(): PromiseBluebird; } interface Test extends superagent.Request { url: string; serverAddress(app: any, path: string): string; expect(status: number): Promise; expect(status: number, body: string): Promise; expect(body: string): Promise; expect(body: RegExp): Promise; expect(body: Object): Promise; expect(field: string, val: string): Promise; expect(field: string, val: RegExp): Promise; expect(checker: (res: Response) => any): Promise; } interface Response extends superagent.Response { } } export = supertest; }