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

    Function endsWithMembersFunc

    Export assertion functions

    • Checks if an array ends with a specific sequence of members using strict equality.

      The function verifies that the last N elements of the array match the expected sequence, where N is the length of the expected array. Uses strict equality (===) for comparison.

      Type Parameters

      • R

      Parameters

      Returns R

      The current assertion scope for chaining

      assert([1, 2, 3, 4, 5]).has.endsWithMembers([4, 5]);      // Passes
      assert([1, 2, 3, 4, 5]).has.endsWithMembers([5]); // Passes
      assert([1, 2, 3, 4, 5]).has.endsWithMembers([3, 4]); // Fails - doesn't end with [3, 4]
      assert([1, 2, 3]).has.endsWithMembers([]); // Passes - empty sequence
      assert(new Set([1, 2, 3])).has.endsWithMembers([2, 3]); // Passes - different types