chai-http

  • Version 4.3.0
  • Published
  • 200 kB
  • 7 dependencies
  • MIT license

Install

npm i chai-http
yarn add chai-http
pnpm add chai-http

Overview

Extend Chai Assertion library with tests for http apis

Index

Functions

function chaiHttp

chaiHttp: (chai: any, utils: any) => void;

    Namespaces

    namespace global

    namespace global {}

      namespace global.Chai

      namespace global.Chai {}

        interface Assertion

        interface Assertion {}

          property headers

          headers: Assertion;

            property html

            html: Assertion;

              property json

              json: Assertion;

                property redirect

                redirect: Assertion;

                  property text

                  text: Assertion;

                    method cookie

                    cookie: (key: string, value?: string) => Assertion;

                      method header

                      header: (key: string, value?: string | RegExp) => Assertion;

                        method param

                        param: (key: string, value?: string) => Assertion;

                          method redirectTo

                          redirectTo: (location: string | RegExp) => Assertion;

                            method status

                            status: (code: number) => Assertion;

                              method statusCode

                              statusCode: (code: number) => Assertion;

                                interface ChaiHttpRequest

                                interface ChaiHttpRequest {}

                                  method addPromises

                                  addPromises: (promiseConstructor: PromiseConstructorLike) => void;

                                    method agent

                                    agent: (server: any) => ChaiHttp.Agent;

                                      call signature

                                      (server: any): ChaiHttp.Agent;

                                        interface ChaiStatic

                                        interface ChaiStatic {}

                                          property request

                                          request: ChaiHttpRequest;

                                            interface TypeComparison

                                            interface TypeComparison {}

                                              property ip

                                              ip: Assertion;

                                                namespace global.ChaiHttp

                                                namespace global.ChaiHttp {}

                                                  interface Agent

                                                  interface Agent extends request.SuperAgentStatic {}

                                                    method close

                                                    close: (callback?: (err: any) => void) => Agent;

                                                      method keepOpen

                                                      keepOpen: () => Agent;

                                                        interface Response

                                                        interface Response extends request.Response {}

                                                          Package Files (1)

                                                          Dependencies (7)

                                                          Dev Dependencies (10)

                                                          Peer Dependencies (0)

                                                          No peer dependencies.

                                                          Badge

                                                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/chai-http.

                                                          • Markdown
                                                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/chai-http)
                                                          • HTML
                                                            <a href="https://www.jsdocs.io/package/chai-http"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>