Skip to main content
Module

x/unitest/mod.ts>toMatch

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

Use .toMatch to check that a string matches a regular expression

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

test("passes when value match string or regExp", () => {
  expect("hello world").toMatch(/^hello/);
});

Parameters

actual: string
expected: string | RegExp