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

    Function includeMembersFunc

    Export assertion functions

    • Asserts that the target includes all members of the expected value (order doesn't matter). Uses strict equality (===) for comparison. Both the target and expected values must conform to ArrayLikeOrSizedIterable but can be different concrete types.

      Note on NaN: Since this function uses strict equality (===), NaN values will NOT match other NaN values. Use includeDeepMembersFunc if you need NaN values to be considered equal.

      Type Parameters

      • R

      Parameters

      Returns R

      • The assert scope.

      0.1.5

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

      assert([1, 2, 3, 4]).includes.members([2, 4]); // Passes - subset present
      assert([1, 2, 3, 4]).includes.members([4, 2]); // Passes - order doesn't matter
      assert([1, 2, 3]).includes.members([1, 2, 3, 4]); // Fails - not a subset
      assert([1, 2, 3]).includes.members([5]); // Fails - member not found
      assert(new Set([1, 2, 3, 4])).includes.members([2, 4]); // Passes - different types

      // NaN behavior
      assert([NaN, 1, 2]).includes.members([NaN]); // Fails - NaN !== NaN with strict equality