assertNotMatch

import { assertNotMatch } from "jsr:@ende/assert";

function

function assertNotMatch(actual: string, expected: RegExp, msg?: string): void

Make an assertion that actual not match RegExp expected. If match then throw.

actual: string

The actual value to match.

expected: RegExp

The expected value to not match.

msg?: string

The optional message to display if the assertion fails.

Example: Usage

import { assertNotMatch } from "@ende/assert";

assertNotMatch("Denosaurus", /Raptor/); // Doesn't throw
assertNotMatch("Raptor", /Raptor/); // Throws

Source