-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dependency on chai #20429
Remove dependency on chai #20429
Conversation
97d3a4d
to
f13089e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I notice that the build still failed on this PR. Any idea why?
The tests succeed when run directly. At some point in the tests there's a global state change such that |
Should we update the @types/chai dependency to an older version for now? |
this is concerning.. I see you removed use of |
I can use the previous commit as a repro but it will take a while to find out what went wrong. Can we merge this in the meantime? |
Fix for global state is at #20471 |
} | ||
|
||
function isDeepEqual<T>(a: T, b: T): boolean { | ||
if (a === b) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea if we have any tests which could trigger this (probably not), but NaN === NaN
is false, but I'd generally say one would expect { x: NaN }
to deep equal { x: NaN }
; ergo there should probably be a clause if (a !== a && b !== b) return true;
. Probably a pointless remark unless we start testing more NaN
y edgecases, though.
It's also worth noting that this change is going to give worse error output when debugging, since you'll no longer get pretty object diffs from any of the error messages from our custom |
Removes the over 22000 line
chai
package and replaces it with under 50 lines of assertion functions.(Background: Builds were failing because the latest
@types/chai
no longer creates a global variable for types. Normally this is a good thing but without #14844 we can no longer refer to the type in a global context.)