@nevware21/tripwire - v0.1.2
    Preparing search index...

    Function addAssertInstFunc

    • Adds a single scope function to the assert (instance) prototype, which will extend (or replace) IAssertInst definition, you can then use the IExtendedAssertInst type to cast the instance object returned via the expect function as it will contain the newly added function.

      Note: These functions are NOT added to the assert or the instance returned via the createAssert only the IAssertInst object returned via the expect function.

      Type Parameters

      • T

      Parameters

      • name: keyof T

        The name of the function to add.

      • func: IScopeFn

        The function to add.

      Returns void

      addAssertInstFunc("myFunc", function myFunc(this: IAssertScope) {
      // Do something
      });

      interface MyExpect extends IAssertInst {
      myFunc(): void;
      }

      let inst = expect("hello");
      let extInst = inst as IExtendedAssertInst<MyExpect>;
      extInst.myFunc();

      0.1.0