Skip to main content
Module

x/unitest/mod.ts>toContain

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

Use .toContain when you want to check that an item is in an array

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

test("passes when array contains given value", () => {
  expect([1, 2, 3, 4, 5]).toContain(3);
  expect([{}, [], ""]).not.toContain(3);
});

Parameters

actual: Iterable<unknown>
expected: Primitive