The first value to compare
// Basic equality
TestValidator.equals("response should match expected", expectedUser, actualUser);
// Ignore timestamps in comparison
TestValidator.equals("user data should match", expectedUser, actualUser,
(key) => key === "updatedAt"
);
// Validate API response structure
TestValidator.equals("API response structure",
{ id: 1, name: "John" },
{ id: 1, name: "John" }
);
// Type-safe nullable comparisons
const nullableData: { name: string } | null = getData();
TestValidator.equals("nullable check", nullableData, null);
Validates deep equality between two values using JSON comparison.
Performs recursive comparison of objects and arrays. Supports an optional exception filter to ignore specific keys during comparison. Useful for validating API responses, data transformations, and object state changes.