Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chai] added missing notIncludeDeepMembers assertion #69247

Merged
merged 1 commit into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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