test/asserts.ts: assertEquals() doesn't show a diff when two different constructors have the same name
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 681
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When comparing two large objects that are almost the same, except for the two using two different instances of a constructor, the function throws without giving any helpful info about what part of the object isn't equal.
**Steps to Reproduce**
```js
import {assertEquals} from "https://deno.land/std@0.137.0/testing/asserts.ts";
function createObject() {
class MyCoolConstructor {}
return {
someData: "place a substitute for a large amount of data here...",
foo: new MyCoolConstructor(),
};
}
const a = createObject();
const b = createObject();
assertEquals(a, b);
```
When the objects being compared are small, like in this example, it's easy enough to figure out that the issue is that `MyCoolConstructor` are two different classes. But if `someData` is replaced with a large enough object, this is much more difficult to figure out.
**Expected behavior**
The error message shows that `MyCoolConstructor {}` and `MyCoolConstructor {}` are not the same.
**Environment**
- OS: macOS `12.3.1`
- deno version: `1.21.1`
- std version: `0.137.0`
Contributor guide
Assessment
This issue has not been assessed yet.