Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/unitest/matcher/mod.ts>toIncludeMultiple

๐Ÿƒ Deno-first universal unit testing framework
Latest
function toIncludeMultiple
Re-export
import { toIncludeMultiple } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/mod.ts";

Use .toIncludeMultiple when checking if a string includes all of the given substrings

import {
  defineExpect,
  not,
  test,
  toIncludeMultiple,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";

const expect = defineExpect({
  matcherMap: {
    toIncludeMultiple,
  },
  modifierMap: {
    not,
  },
});

test("passes when value includes all substrings", () => {
  expect("hello world").toIncludeMultiple(["world", "hello"]);
  expect("hello world").not.toIncludeMultiple(["world", "hello", "bob"]);
});

Parameters

actual: string
expected: string[]