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

    Parameters

    • actual: string
    • expected: RegExp
    • Optional msg: string

    Returns void

    Since

    24.7.0

    Example

    import { assertMatch } from "assert";

    assertMatch("Raptor", RegExp(/Raptor/)); // Doesn't throw
    assertMatch("Bingosaurus", RegExp(/Raptor/)); // Throws