supertest/000755 001751 001751 0000000000 15147666464014657 5ustar00runner000000 000000 1514766646415147666464supertest/LICENSE000644 001751 001751 0000002165 15147666464015670 0ustar00runner000000 000000 1514766646415147666464 MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE supertest/README.md000644 001751 001751 0000001262 15147666464016137 0ustar00runner000000 000000 1514766646415147666464# Installation > `npm install --save @types/supertest` # Summary This package contains type definitions for supertest (https://github.com/visionmedia/supertest). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supertest. ### Additional Details * Last updated: Wed, 25 Feb 2026 21:44:20 GMT * Dependencies: [@types/methods](https://npmjs.com/package/@types/methods), [@types/superagent](https://npmjs.com/package/@types/superagent) # Credits These definitions were written by [Alex Varju](https://github.com/varju), [Petteri Parkkila](https://github.com/pietu), and [David Tanner](https://github.com/DavidTanner). supertest/index.d.ts000644 001751 001751 0000002330 15147666464016556 0ustar00runner000000 000000 1514766646415147666464import superagent = require("superagent"); import stAgent = require("./lib/agent"); import STest = require("./lib/test"); import cookies = require("./lib/cookies"); import { AgentOptions as STAgentOptions, App } from "./types"; declare const supertest: supertest.SuperTestStatic; declare namespace supertest { type Response = superagent.Response; type Request = superagent.SuperAgentRequest; type CallbackHandler = superagent.CallbackHandler; // eslint-disable-next-line @typescript-eslint/no-empty-interface interface Test extends STest {} // eslint-disable-next-line @typescript-eslint/no-empty-interface interface Agent extends stAgent {} interface Options { http2?: boolean; } type AgentOptions = STAgentOptions; type SuperTest = superagent.SuperAgent; type SuperAgentTest = SuperTest; type CustomAssertionCookie = cookies.CustomAssertionCookie; interface SuperTestStatic { (app: App, options?: STAgentOptions): stAgent; Test: typeof STest; agent: typeof stAgent & ((app?: App, options?: STAgentOptions) => InstanceType); cookies: typeof cookies; } } export = supertest; supertest/lib/000755 001751 001751 0000000000 15147666464015425 5ustar00runner000000 000000 1514766646415147666464supertest/package.json000644 001751 001751 0000002251 15147666464017145 0ustar00runner000000 000000 1514766646415147666464{ "name": "@types/supertest", "version": "7.2.0", "description": "TypeScript definitions for supertest", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supertest", "license": "MIT", "contributors": [ { "name": "Alex Varju", "githubUsername": "varju", "url": "https://github.com/varju" }, { "name": "Petteri Parkkila", "githubUsername": "pietu", "url": "https://github.com/pietu" }, { "name": "David Tanner", "githubUsername": "DavidTanner", "url": "https://github.com/DavidTanner" } ], "main": "", "types": "index.d.ts", "repository": { "type": "git", "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", "directory": "types/supertest" }, "scripts": {}, "dependencies": { "@types/methods": "^1.1.4", "@types/superagent": "^8.1.0" }, "peerDependencies": {}, "typesPublisherContentHash": "05480a1282574122d02d8f41360f4855ec9ed3cb420405910400a3c96f94b92b", "typeScriptVersion": "5.2" }supertest/types.d.ts000644 001751 001751 0000001141 15147666464016612 0ustar00runner000000 000000 1514766646415147666464import { AgentOptions as SAgentOptions } from "superagent"; import methods = require("methods"); import { IncomingMessage, RequestListener, ServerResponse } from "http"; import { Http2ServerRequest, Http2ServerResponse } from "http2"; import { Server } from "net"; export type App = | Server | RequestListener | ((request: Http2ServerRequest, response: Http2ServerResponse) => void | Promise) | string; export interface AgentOptions extends SAgentOptions { http2?: boolean; } export type AllMethods = typeof methods[number] | "del"; supertest/lib/agent.d.ts000644 001751 001751 0000004647 15147666464017330 0ustar00runner000000 000000 1514766646415147666464import superagent = require("superagent"); import { Test } from "../index"; import { AgentOptions, App } from "../types"; declare class TestAgent extends superagent.agent { constructor( app?: App, options?: AgentOptions, ); host(host: string): this; "M-SEARCH"(url: string): Req; "m-search"(url: string): Req; ACL(url: string): Req; BIND(url: string): Req; CHECKOUT(url: string): Req; CONNECT(url: string): Req; COPY(url: string): Req; DELETE(url: string): Req; GET(url: string): Req; HEAD(url: string): Req; LINK(url: string): Req; LOCK(url: string): Req; MERGE(url: string): Req; MKACTIVITY(url: string): Req; MKCALENDAR(url: string): Req; MKCOL(url: string): Req; MOVE(url: string): Req; NOTIFY(url: string): Req; OPTIONS(url: string): Req; PATCH(url: string): Req; POST(url: string): Req; PROPFIND(url: string): Req; PROPPATCH(url: string): Req; PURGE(url: string): Req; PUT(url: string): Req; REBIND(url: string): Req; REPORT(url: string): Req; SEARCH(url: string): Req; SOURCE(url: string): Req; SUBSCRIBE(url: string): Req; TRACE(url: string): Req; UNBIND(url: string): Req; UNLINK(url: string): Req; UNLOCK(url: string): Req; UNSUBSCRIBE(url: string): Req; acl(url: string): Req; bind(url: string): Req; checkout(url: string): Req; connect(url: string): Req; copy(url: string): Req; del(url: string): Req; delete(url: string): Req; get(url: string): Req; head(url: string): Req; link(url: string): Req; lock(url: string): Req; merge(url: string): Req; mkactivity(url: string): Req; mkcalendar(url: string): Req; mkcol(url: string): Req; move(url: string): Req; notify(url: string): Req; options(url: string): Req; patch(url: string): Req; post(url: string): Req; propfind(url: string): Req; proppatch(url: string): Req; purge(url: string): Req; put(url: string): Req; rebind(url: string): Req; report(url: string): Req; search(url: string): Req; source(url: string): Req; subscribe(url: string): Req; trace(url: string): Req; unbind(url: string): Req; unlink(url: string): Req; unlock(url: string): Req; unsubscribe(url: string): Req; } export = TestAgent; supertest/lib/cookies.d.ts000644 001751 001751 0000004571 15147666464017662 0ustar00runner000000 000000 1514766646415147666464declare const expectCookies: expectCookies.ExpectCookiesStatic; declare namespace expectCookies { interface Assertion { set(expects: SetMatcher | ReadonlyArray, assert?: boolean): this; reset(expects: ResetMatcher | ReadonlyArray, assert?: boolean): this; "new"(expects: ResetMatcher | ReadonlyArray, assert?: boolean): this; renew(expects: RenewMatcher | ReadonlyArray, assert?: boolean): this; contain(expects: ContainMatcher | ReadonlyArray, assert?: boolean): this; not>( method: M, expects: AssertionMatchers[M] | ReadonlyArray, ): this; } type CustomAssertion = ( req: { cookies: CustomAssertionCookie[] }, res: { cookies: CustomAssertionCookie[] }, ) => boolean; interface CustomAssertionCookie { name: string; value: string; options?: Record; } interface AssertionMatchers { readonly set: SetMatcher; readonly reset: ResetMatcher; readonly new: NewMatcher; readonly renew: RenewMatcher; readonly contain: ContainMatcher; } interface SetMatcher { readonly name: string; readonly options?: Record; } interface ResetMatcher { readonly name: string; } type NewMatcher = ResetMatcher; interface RenewMatcher { readonly name: string; readonly options: | { "max-age": number; expires?: never } | { expires: Date; "max-age"?: never }; } interface ContainMatcher { readonly name: string; readonly value: string | boolean; readonly options?: { readonly domain?: string; readonly path?: string; readonly expires?: string; // RFC 6265 sane-cookie-date (e.g. "Fri, 26 Sep 2025 04:26:52 GMT") readonly secure?: boolean; readonly httponly?: boolean; readonly "max-age"?: string; }; } interface ExpectCookiesStatic extends Assertion { ( secret?: string | ReadonlyArray | null, asserts?: CustomAssertion | ReadonlyArray, ): Assertion; } } export = expectCookies; supertest/lib/test.d.ts000644 001751 001751 0000001557 15147666464017206 0ustar00runner000000 000000 1514766646415147666464import { CallbackHandler, Request, Response } from "superagent"; import { App } from "../types"; declare class Test extends Request { constructor(app: App, method: string, path: string); app: App; url: string; serverAddress(app: App, 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; end(callback?: CallbackHandler): this; } export = Test;