@types/promisify-supertest
TypeScript icon, indicating that this package has built-in type declarations

1.0.38 • Public • Published

Installation

npm install --save @types/promisify-supertest

Summary

This package contains type definitions for promisify-supertest (https://www.npmjs.com/package/promisify-supertest).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promisify-supertest.

index.d.ts

// Mostly copy-pasted from supertest.d.ts

import * as express from "express";
import * as superagent from "superagent";

type CallbackHandler = (err: any, res: supertest.Response) => void;

declare function supertest(app: express.Express): supertest.SuperTest;

declare namespace supertest {
    function agent(app?: any): supertest.SuperTest;

    interface SuperTest extends superagent.SuperAgent<Test> {
    }

    interface Test extends superagent.SuperAgentRequest {
        url: string;
        serverAddress(app: any, path: string): string;
        expect(status: number, callback?: CallbackHandler): this;
        expect(status: number, body: string, callback?: CallbackHandler): this;
        expect(body: string, callback?: CallbackHandler): this;
        expect(body: RegExp, callback?: CallbackHandler): this;
        expect(body: Object, callback?: CallbackHandler): this;
        expect(field: string, val: string, callback?: CallbackHandler): this;
        expect(field: string, val: RegExp, callback?: CallbackHandler): this;
        expect(checker: (res: Response) => any): this;
        end(callback?: CallbackHandler): this & Promise<Response>;
    }

    interface Response extends superagent.Response {
    }
}

export = supertest;

Additional Details

Credits

These definitions were written by Leo Liang.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/promisify-supertest

Weekly Downloads

7

Version

1.0.38

License

MIT

Unpacked Size

5.31 kB

Total Files

5

Last publish

Collaborators

  • types