# @types/supertest-as-promised

> TypeScript definitions for supertest-as-promised

Latest version **2.0.43** (published 2025-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/supertest-as-promised
pnpm add @types/supertest-as-promised
yarn add @types/supertest-as-promised
bun add @types/supertest-as-promised
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.43 |
| Published | 2025-10-24 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/supertest-as-promised
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supertest-as-promised
- npm.io page: https://npm.io/package/@types/supertest-as-promised

## Dependencies (3)

- [@types/bluebird](https://npm.io/package/@types/bluebird.md) *
- [@types/supertest](https://npm.io/package/@types/supertest.md) *
- [@types/superagent](https://npm.io/package/@types/superagent.md) *

## Recent versions

- 2.0.43 (latest) — 2025-10-24
- 2.0.42 (ts4.6) — 2023-12-21
- 2.0.41 (ts4.5) — 2023-11-07
- 2.0.38 (ts3.8) — 2019-05-24
- 2.0.37 (ts2.9) — 2019-03-05
- 2.0.35 (ts2.4) — 2017-11-09
- 2.0.34 (ts2.2) — 2017-03-09
- 2.0.33 (ts2.0) — 2017-02-23
- 2.0.40 — 2023-10-18
- 2.0.39 — 2023-09-25
- 2.0.36 — 2018-07-14
- 2.0.32 — 2016-09-19
- 2.0.31 — 2016-08-25
- 2.0.30 — 2016-08-18
- 2.0.29 — 2016-08-08
- … 11 more at https://npm.io/package/@types/supertest-as-promised/versions

## README

# Installation
> `npm install --save @types/supertest-as-promised`

# Summary
This package contains type definitions for supertest-as-promised (https://github.com/WhoopInc/supertest-as-promised).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supertest-as-promised.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supertest-as-promised/index.d.ts)
````ts
import PromiseBluebird = require("bluebird");
import supertest = require("supertest");
import { Server } from "tls";

declare function supertestAsPromised(app: any): supertestAsPromised.SuperTest;

declare namespace supertestAsPromised {
    interface Request extends supertest.Request {
    }

    interface Response extends supertest.Response {
    }

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

    interface Test extends supertest.Request {
        toPromise(): PromiseBluebird<Response & Test>;
        timeout(): Promise<Response> & this;
        end(callback?: CallbackHandler): this;
        app: Server;
        url: string;

        serverAddress(app: Server, path: string): string;

        expect(status: number, callback?: CallbackHandler): this;
        expect(status: number, body: any, callback?: CallbackHandler): 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;
        expect(field: string, val: string, callback?: CallbackHandler): this;
        expect(field: string, val: RegExp, callback?: CallbackHandler): this;
    }

    function agent(app?: any): SuperTest;

    interface SuperTest extends supertest.SuperTest<Test> {
    }
}
export = supertestAsPromised;

````

### Additional Details
 * Last updated: Fri, 24 Oct 2025 04:02:41 GMT
 * Dependencies: [@types/bluebird](https://npmjs.com/package/@types/bluebird), [@types/superagent](https://npmjs.com/package/@types/superagent), [@types/supertest](https://npmjs.com/package/@types/supertest)

# Credits
These definitions were written by [Tanguy Krotoff](https://github.com/tkrotoff).

---
_Source: https://npm.io/package/@types/supertest-as-promised · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
