Skip to main content
Module

x/unitest/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/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[]