Function assertNotEquals

  • Make an assertion that actual and expected are not equal, deeply. If not then throw.

    Type parameter can be specified to ensure values under comparison have the same type.

    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 { assertNotEquals } from "@std/assert";

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