Documentation
    Preparing search index...
    • Validates deep inequality between two values using JSON comparison.

      Performs recursive comparison of objects and arrays to ensure they are NOT equal. Supports an optional exception filter to ignore specific keys during comparison. Useful for validating that data has changed, objects are different, or mutations have occurred.

      Type Parameters

      • X
      • Y = X

      Parameters

      • title: string

        Descriptive title used in error messages when values are equal

      • x: X

        The first value to compare

      • y: Y | null | undefined

        The second value to compare (can be null or undefined)

      • Optionalexception: (key: string) => boolean

        Optional filter function to exclude specific keys from comparison

      Returns void

        // Basic inequality
      TestValidator.notEquals("user should be different after update", originalUser, updatedUser);

      // Ignore timestamps in comparison
      TestValidator.notEquals("user data should differ", originalUser, modifiedUser,
      (key) => key === "updatedAt"
      );

      // Validate state changes
      TestValidator.notEquals("state should have changed", initialState, currentState);

      // Type-safe nullable comparisons
      const mutableData: { count: number } | null = getMutableData();
      TestValidator.notEquals("should have changed", mutableData, null);

      Error when values are equal (indicating validation failure)