import { toInclude } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/mod.ts";
Use .toInclude
when checking if a string
includes the given string
substring
import {
defineExpect,
not,
test,
toInclude,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";
const expect = defineExpect({
matcherMap: {
toInclude,
},
modifierMap: {
not,
},
});
test("passes when value includes substring", () => {
expect("hello world").toInclude("ell");
expect("hello world").not.toInclude("bob");
});