Function assertNotStrictEquals

  • Make an assertion that actual and expected are not strictly equal, using Object.is for equality comparison. If the values are strictly equal 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 { assertNotStrictEquals } from "@std/assert";

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

    assertNotStrictEquals(0, 0); // Throws
    assertNotStrictEquals(0, -0); // Doesn't throw