Skip to content

BigInt are not supported in .deep.equal() #1623

@SmashingQuasar

Description

@SmashingQuasar

Hey!

I am using the latest version of Chai and it appears if you try to deep equal an object that has a property of type BigInt, Chai will throw an Error.

Here is a code sample that should reproduce the issue (TypeScript):

import { describe, it } from "mocha";
import { expect } from "chai";

class Foo {
  private bar: BigInt = 0n;
}

describe("BigInt are not supported", (): void => {
  it("should work", (): void => {
    const instance: Foo = new Foo();
    const secondInstance: Foo = new Foo();

    expect(instance).to.deep.equal(secondInstance); // This will throw
  });
});

Support for BigInt was apparently added a while back but it seems it no longer works or deep.equal did not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting-on-reporterIssues where we are waiting to hear back from the original reporter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions