import { toBeOneOf } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/to_be_one_of.ts";
Use .toBeOneOf
when checking if a value is a member of a given Array
import {
defineExpect,
not,
test,
toBeOneOf,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";
const expect = defineExpect({
matcherMap: {
toBeOneOf,
},
modifierMap: {
not,
},
});
test("passes when value is in given array", () => {
expect(1).toBeOneOf([1, 2, 3]);
expect(4).not.toBeOneOf([1, 2, 3]);
});