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

    Interface EqualFn<R>

    Identifies the signature of the equals function that performs equality checks between the actual and expected values, throwing an AssertionFailure with the given message when the actual value is not equal to the expected value. The actual equality check is based on the implementation of this signature, and may be either a strict or loose equality check.

    Type Parameters

    • R
    • Identifies the signature of the equals function that performs equality checks between the actual and expected values, throwing an AssertionFailure with the given message when the actual value is not equal to the expected value. The actual equality check is based on the implementation of this signature, and may be either a strict or loose equality check.

      Type Parameters

      • T

        The type of the expected value.

      Parameters

      • expected: T

        The expected value.

      • OptionalevalMsg: MsgSource

        The message to display if the values are strictly equal.

      Returns R

      AssertionFailure - If the expected and actual values are strictly equal.

      assert.equal(1, 1); // Passes
      assert.equal("a", "a"); // Passes
      assert.equal(true, true); // Passes
      assert.equal(false, false); // Passes
      assert.equal(null, null); // Passes
      assert.equal(undefined, undefined); // Passes
      assert.equal(0, 0); // Passes
      assert.equal(-0, -0); // Passes
      assert.equal(+0, +0); // Passes
      assert.equal(0n, 0n); // Passes
      assert.equal("", ""); // Passes
      assert.equal(Symbol(), Symbol()); // Passes
      assert.equal([], []); // Throws AssertionError
      assert.equal([1, 2], [1, 2]); // Throws AssertionError