Document that the jest code mods won't cover all cases?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 115
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying out migrating from mocha & expect to just jest.
The code mods handled most of the cases, but there are some MAJOR differences in how Jest's isEqual matcher works, mostly because it does not use the is-equal package anymore.
This means things like this worked with expect but DO NOT work with jest:
expect(["abc"]).toEqual("abc");
function createEnhancedFunction() {
var myFunction = function() { return "a value"; };
myFunction.a = "123";
return myFunction;
}
expect({ a: createEnhancedFunction() }).toEqual({ a: createEnhancedFunction() });
The first difference is easy to work around, but the second one (inability to compare functions and treat them as equal) has me a little stumped.
I'd think it would be good to emphasize that is-equal is no longer used for equality checks, and maybe suggest some workarounds in the docs?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the migration and code-mod documentation for the Mocha/expect-to-Jest transition. Document that equality behavior differs because is-equal is no longer used, include the reported examples, and explain any supported workarounds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100