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

    Function createEvalAdapter

    • Creates an adapter function that can be used to evaluate the current value in the scope, using the provided boolean evaluation function.

      Parameters

      • evalFn: EvalFn

        The function that will be used to evaluate the current value.

      • OptionalevalMsg: MsgSource

        The message that will be used if the evaluation fails.

      • OptionalfuncName: string

        The name of the function that will be used to identify the operation.

      Returns IScopeFn

      An IScopeFn function that will evaluate the current value in the scope.

      import { createEvalAdapter } from "@nevware21/tripwire";

      addAssertFunc("isTrue", createEvalAdapter((actual: any) => actual === true, "Expected value to be true"););
      assert.isTrue(true); // Passes
      assert.isTrue(false); // Fails

      0.1.0