• Version 4.4.0
  • Published
  • 276 kB
  • 8 dependencies
  • MIT license


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


Extend Chai Assertion library with tests for http apis



function chaiHttp

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


    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 charset

                    charset: (charset: string) => 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 (8)

                                                            Dev Dependencies (16)

                                                            Peer Dependencies (0)

                                                            No peer dependencies.


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

                                                            You may also use to create a custom badge linking to

                                                            • Markdown
                                                            • HTML
                                                              <a href=""><img src="" alt=""></a>