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

    Function increasesByFunc

    Export assertion functions

    • Asserts that executing the target function increases the monitored value by a specific delta. Unlike changesByFunc, the delta must be positive and the value must actually increase.

      Type Parameters

      • R
      • T = any

      Parameters

      • this: IAssertScope

        The current IAssertScope object

      • getter: T | (() => any)

        A function that returns a value to monitor, or an object containing the property to monitor

      • Optionalprop: keyof T

        The property name to monitor (only used when first argument is an object)

      • Optionaldelta: number | MsgSource

        The expected increase amount (must be a positive number)

      • OptionalevalMsg: MsgSource

        Optional message to display if the assertion fails

      Returns R

      The current IAssertScope.that object

      let count = 5;
      const getCount = () => count;
      const addTen = () => { count += 10; };

      expect(addTen).to.increaseBy(getCount, 10); // Passes - increased by exactly 10