Skip to content

Commit

Permalink
[chai] added missing notIncludeDeepMembers assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
AM1988 committed Apr 2, 2024
1 parent e5d07ac commit 9364edf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions types/chai/chai-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2489,4 +2489,8 @@ suite("assert", () => {
"Should have correct value of the property",
);
});

test("notIncludeDeepMembers", () => {
assert.notIncludeDeepMembers([{ a: 1 }, { b: 2 }, { c: 3 }], [{ b: 2 }], "not include deep members");
});
});
13 changes: 13 additions & 0 deletions types/chai/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,19 @@ declare namespace Chai {
*/
includeDeepMembers<T>(superset: T[], subset: T[], message?: string): void;

/**
* Asserts that `subset` isn't included in `superset` in any order. Uses a
* deep equality check. Duplicates are ignored.
*
* assert.notIncludeDeepMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { b: 2 }, { f: 5 } ], 'not include deep members');
*
* T Type of set values.
* @param superset Actual set of values.
* @param subset Potential contained set of values.
* @param message Message to display on error.
*/
notIncludeDeepMembers<T>(superset: T[], subset: T[], message?: string): void;

/**
* Asserts that non-object, non-array value inList appears in the flat array list.
*
Expand Down

0 comments on commit 9364edf

Please sign in to comment.