You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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";classFoo{privatebar: BigInt=0n;}describe("BigInt are not supported",(): void=>{it("should work",(): void=>{constinstance: Foo=newFoo();constsecondInstance: Foo=newFoo();expect(instance).to.deep.equal(secondInstance);// This will throw});});
i tried the exact code in the first post and it seems to work fine for me
could you give some more info, like how you're building and running this test?
e.g. do you use ts-node or do you run the built JS? do you output commonjs or esm? etc etc
Hey!
Thanks for your answer. To help understand this problem, I will create a repository aiming to replicate the issue with a few dependencies and code as possible and post it here. That way I will either find my own mistake or save you time instead of making you blindly look for the problem.
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):
Support for BigInt was apparently added a while back but it seems it no longer works or
deep.equal
did not work.The text was updated successfully, but these errors were encountered: