Automattic / Automattic/expect.js
Loose equality checking for functions
Open
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 207
- PR merge metrics
- No merged PRs in 30d
Description
Loose equality checking does not currently work with functions:
``` js
expect(function() {}).to.eql(function() {}); // throws
```
We could use the `toString` method of the function to check for equality. This would likely fall back to checking if both objects are functions in older browsers. Some engines perform transforms on the functions (like precomputing static operations), but they should do so consistently, so the functions would still come out the same.
Thoughts?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.