@types/expect.js

  • Version 0.3.32
  • Published
  • 7.32 kB
  • No dependencies
  • MIT license

Install

npm i @types/expect.js
yarn add @types/expect.js
pnpm add @types/expect.js

Overview

TypeScript definitions for expect.js

Index

Functions

function expect

expect: (target?: any) => Expect.Root;

    Namespaces

    namespace Expect

    namespace Expect {}

      interface An

      interface An extends Assertion {}

        call signature

        (type: string): Assertion;
        • Assert typeof.

        call signature

        (type: Function): Assertion;
        • Assert instanceof.

        interface Assertion

        interface Assertion {}

          property an

          an: An;
          • Assert typeof / instanceof.

          method a

          a: { (type: string): Assertion; (type: Function): Assertion };
          • Assert typeof.

          • Assert instanceof.

          method above

          above: (n: number) => Assertion;
          • Assert numeric value above n.

          method below

          below: (n: number) => Assertion;
          • Assert numeric value below n.

          method contain

          contain: { (str: string): Assertion; (obj: any): Assertion };
          • Assert that string contains str.

          • Assert that the array contains obj.

          method empty

          empty: () => Assertion;
          • Checks if the array is empty.

          method eql

          eql: (obj: any) => Assertion;
          • Checks if the obj sortof equals another.

          method equal

          equal: (obj: any) => Assertion;
          • Checks if the obj exactly equals another.

          method fail

          fail: (message?: string) => Assertion;
          • Assert a failure.

          method greaterThan

          greaterThan: (n: number) => Assertion;
          • Assert numeric value above n.

          method key

          key: { (keys: string[]): Assertion; (...keys: string[]): Assertion };
          • Assert exact keys or inclusion of keys by using the .own modifier.

          method keys

          keys: { (keys: string[]): Assertion; (...keys: string[]): Assertion };
          • Assert exact keys or inclusion of keys by using the .own modifier.

          method length

          length: (n: number) => Assertion;
          • Assert property "length" exists and has value of n.

            Parameter n

          method lessThan

          lessThan: (n: number) => Assertion;
          • Assert numeric value below n.

          method match

          match: (regexp: RegExp) => Assertion;
          • Assert string value matches regexp.

            Parameter regexp

          method ok

          ok: () => void;
          • Check if the value is truthy

          method property

          property: (name: string, val?: any) => Assertion;
          • Assert property name exists, with optional val.

            Parameter name

            Parameter val

          method string

          string: { (str: string): Assertion; (obj: any): Assertion };

            method throwError

            throwError: { (fn?: (exception: any) => void): void; (regexp: RegExp): void };
            • Assert that the function throws.

              Parameter fn

              callback to match error string against

            • Assert that the function throws.

              Parameter regexp

              regexp to match error string against

            method throwException

            throwException: {
            (fn?: (exception: any) => void): void;
            (regexp: RegExp): void;
            };
            • Assert that the function throws.

              Parameter fn

              callback to match error string against

            method withArgs

            withArgs: (...args: any[]) => Root;
            • Creates an anonymous function which calls fn with arguments.

            method within

            within: (start: number, finish: number) => Assertion;
            • Assert within start to finish (inclusive).

              Parameter start

              Parameter finish

            interface Be

            interface Be extends Assertion {}

              property an

              an: An;

                call signature

                (obj: any): Assertion;
                • Checks if the obj exactly equals another.

                interface Have

                interface Have extends Assertion {}

                  property own

                  own: Assertion;

                    interface Not

                    interface Not extends Expect.NotBase {}

                      property to

                      to: Expect.ToBase;

                        interface NotBase

                        interface NotBase extends Assertion {}

                          property be

                          be: Be;

                            property have

                            have: Have;

                              property include

                              include: Assertion;

                                property only

                                only: Only;

                                  interface Only

                                  interface Only extends Assertion {}

                                    property have

                                    have: Have;

                                      interface Root

                                      interface Root extends Assertion {}

                                        property be

                                        be: Be;

                                          property have

                                          have: Have;

                                            property not

                                            not: Not;

                                              property only

                                              only: Only;

                                                property to

                                                to: To;

                                                  interface To

                                                  interface To extends Expect.ToBase {}

                                                    property not

                                                    not: Expect.NotBase;

                                                      interface ToBase

                                                      interface ToBase extends Assertion {}

                                                        property be

                                                        be: Be;

                                                          property have

                                                          have: Have;

                                                            property include

                                                            include: Assertion;

                                                              property only

                                                              only: Only;

                                                                namespace expect.js

                                                                module 'expect.js' {}

                                                                  function expect

                                                                  expect: (target?: any) => Expect.Root;

                                                                    Package Files (1)

                                                                    Dependencies (0)

                                                                    No dependencies.

                                                                    Dev Dependencies (0)

                                                                    No dev dependencies.

                                                                    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/@types/expect.js.

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