setIncluding
Matcher for a Set holding a specific member.
Membership uses the Set’s own has(), which is an identity match for objects, so an equal-valued object held under another reference fails the check.
Matchers are applied through assertObjectMatches, where they narrow the corresponding property type.
Type information that already exists in the calling scope is incorporated.
import { assertObjectMatches, setIncluding } from "@kensio/smartass";
const value: unknown = { tags: new Set(["draft", "featured"]),};
assertObjectMatches(value, { tags: setIncluding("draft"),});
// value is now narrowed to an object with a Set of tags// {// tags: ReadonlySet<"draft">;// }Source
Section titled “Source”Source file: src/assert/set-includes/set-includes.match.ts
