Function assertGreaterOrEqual

  • Make an assertion that actual is greater than or equal to expected. If not then throw.

    Type Parameters

    • T

      The type of the values to compare.

    Parameters

    • actual: T

      The actual value to compare.

    • expected: T

      The expected value to compare.

    • Optionalmsg: string

      The optional message to display if the assertion fails.

    Returns void

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

    assertGreaterOrEqual(2, 1); // Doesn't throw
    assertGreaterOrEqual(1, 1); // Doesn't throw
    assertGreaterOrEqual(0, 1); // Throws