Function assertStringIncludes

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

    Parameters

    • actual: string

      The actual string to check for inclusion.

    • expected: string

      The expected string to check for inclusion.

    • Optionalmsg: string

      The optional message to display if the assertion fails.

    Returns void

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

    assertStringIncludes("Hello", "ello"); // Doesn't throw
    assertStringIncludes("Hello", "world"); // Throws