6.0.2 • Published 1 year ago

@types/supertest v6.0.2

Weekly downloads
889,073
License
MIT
Repository
github
Last release
1 year ago

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.

index.d.ts

// Type definitions for SuperTest v2.0.1
// Project: https://github.com/visionmedia/supertest
// Definitions by: Alex Varju <https://github.com/varju>
//                 Petteri Parkkila <https://github.com/pietu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0

import * as superagent from 'superagent';

export = supertest;

declare function supertest(app: any): supertest.SuperTest<supertest.Test>;
declare namespace supertest {
    interface Response extends superagent.Response {}

    interface Request extends superagent.SuperAgentRequest {}

    type CallbackHandler = (err: any, res: Response) => void;
    interface Test extends superagent.SuperAgentRequest {
        app?: any;
        url: string;
        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, 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;
    }

    interface AgentOptions {
        ca?: any;
    }
    function agent(app?: any, options?: AgentOptions): SuperAgentTest;

    interface SuperTest<T extends superagent.SuperAgentRequest> extends superagent.SuperAgent<T> {}
    interface SuperTestWithHost<T extends superagent.SuperAgentRequest> extends SuperTest<T> {
        host(host: string): this;
    }
    type SuperAgentTest = SuperTestWithHost<Test> &
        Pick<
            Request,
            | 'use'
            | 'on'
            | 'set'
            | 'query'
            | 'type'
            | 'accept'
            | 'auth'
            | 'withCredentials'
            | 'retry'
            | 'ok'
            | 'redirects'
            | 'timeout'
            | 'buffer'
            | 'serialize'
            | 'parse'
            | 'ca'
            | 'key'
            | 'pfx'
            | 'cert'
        >;
}

Additional Details

  • Last updated: Mon, 21 Mar 2022 16:31:45 GMT
  • Dependencies: @types/superagent
  • Global values: none

Credits

These definitions were written by Alex Varju, and Petteri Parkkila.

@withjoy/server-core-testwiser-educacao-ebanx-libraryningiliner-notifications-apimikro-orm-graphql-example@wong-bejo/api@castframework/oraclescupperfy-app-serverbusiness_serviceauthorization_servicehorizon-pro-apiorm-cxmorm-cxm-typescript@everything-registry/sub-chunk-957express-kinttask.ifybackendsveltekit-shopify-apiwaline-web3superwstestsupertest-graphqlvcms@conversationlearner/sdk@coopenomics/controller@detail-dev/replay@cameronjyoung/microservice-util-library@rowboat/shopify-apiapi-test-frameworkjsonoservekickboardkidal-nsfkarma-tsstylomaticsum-mlbonestyped-jesttypecheck-utilstr-data-provider@artlab/testlab@atlasphere/lense@atlasphere/nebula@albiyu/shopify-api@alixq/ticketing-common@axcasella/shopify-api@bumasoft/shopify-api@chasewnorton/shopify-api@chatmate/zodenv@chen-ticket-temp/common6e-alpha-backend-admin@612zyn289/teaproject@hodfords/openapi2sdk@hodfords/openapi2sdk-dashboard@axmit/scythe-core@belvedere/groupr@dbadbadba/shopify-api@constructorfleet/ultimate-goveeyilia-wangyourails_commonyup-schemaswebhook-listenerts-router@elliemae/pui-cli@gasbuddy/service-tester@gams/utility@ghostaramic/z-library@good2meal/core@infinitebrahmanuniverse/nolb-_types_s@kurocado-studio/styleguide@lcdev/router-testing@last9/openapm@lazy_test/cli@loopback/testlab@inward/testlab@link1900/node-test-util@m-ld/gateway@luics/json-server-simple@methodus/platform-express@mhkafadar/shopify-api@mrgoose/opinionated-hapi-builder@nocobase/test@mattmazzola/sdk@midwayjs/mock@midwayjs/test-util@k6js/core@k6js/ks-next@keystone-6-master/core@keystone-next/keystone@imbueapp/mockingbird@imbueapp/mocktillery@juicyllama/dev@jterrazz/package-typescript-test@kevinefra/boiler-node-kevinefra@mornya/node-vessel@omstickets/common@olagg/legacy@openapi-typescript-infra/service-tester@portal-dx/plugin-notifications-backend@ploiid10/shopify-api@orderlycode/nest-test-tools@smallstack/cloud-api@sotah-inc/api@scythe/core
6.0.2

1 year ago

6.0.1

1 year ago

6.0.0

1 year ago

2.0.15

2 years ago

2.0.16

1 year ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.12

3 years ago

2.0.11

4 years ago

2.0.10

5 years ago

2.0.9

5 years ago

2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.1.32

8 years ago

1.1.31

9 years ago

1.1.30

9 years ago

1.1.29

9 years ago

1.1.28

9 years ago

1.1.27

9 years ago

1.1.26-alpha

9 years ago

1.1.25-alpha

9 years ago

1.1.24-alpha

9 years ago

1.1.23-alpha

9 years ago

1.1.22-alpha

9 years ago

1.1.21-alpha

9 years ago

1.1.20-alpha

9 years ago

1.1.15-alpha

9 years ago

1.1.14-alpha

9 years ago