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

    Function endsWithDeepMembersFunc

    Export assertion functions

    • Checks if an array ends with a specific sequence of members using deep 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 deep equality for comparison, making it suitable for arrays containing objects or nested structures.

      Type Parameters

      • R

      Parameters

      Returns R

      The current assertion scope for chaining

      assert([{a: 1}, {b: 2}, {c: 3}]).has.deep.endsWithMembers([{b: 2}, {c: 3}]);  // Passes
      assert([{a: 1}, {b: 2}, {c: 3}]).has.deep.endsWithMembers([{c: 3}]); // Passes
      assert([{a: 1}, {b: 2}, {c: 3}]).has.deep.endsWithMembers([{a: 1}]); // Fails - doesn't end with {a: 1}
      assert(new Set([{a: 1}, {b: 2}])).has.deep.endsWithMembers([{b: 2}]); // Passes - different types