Function assertNotMatch

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

    Parameters

    • actual: string

      The actual value to match.

    • expected: RegExp

      The expected value to not match.

    • Optionalmsg: string

      The optional message to display if the assertion fails.

    Returns void

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

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