// 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);
contracts/common.md#principled-implementation It runs the same comparison as equals and fails when the comparison finds no difference, so two values differing only by extra keys of the second are considered equal and fail.
contracts/common.md#clear-and-simple-design A thin wrapper over the shared comparison with the opposite outcome.
Validates deep inequality between two values using JSON comparison.
Performs recursive comparison of objects and arrays to ensure they are NOT equal, by the same rules as equals: only the keys of the first value are compared, so a key that only the second value has does not make them different. 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.
Processing cost: The shared JSON walker visits the first value and corresponding positions once; a failure additionally serializes both values for diagnostics. Space follows visited structure and reported differences.