Skip to content

assertEquals throws when comparing unique symbols without showing the difference #3370

@jespertheend

Description

@jespertheend

Describe the bug

When two objects contain two unique symbols, assertEquals throws without any meaningful explanation.

Steps to Reproduce

import {assertEquals} from "https://deno.land/std@0.186.0/testing/asserts.ts";
assertEquals(Symbol(), Symbol());

results in the following error:

[Diff] Actual / Expected

Symbol()

Expected behavior

Whether the function should throw is up for debate I think. But the current error message is rather unclear.
This is just a simple example comparing two symbols, but the way I found out about this was because I was comparing two large structures where only a single symbol property was different.

Environment

  • OS: 22.10
  • deno version: 1.32.1
  • std version: 0.186.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions