jest-expect-message
                                
                                 jest-expect-message copied to clipboard
                                
                                    jest-expect-message copied to clipboard
                            
                            
                            
                        Fix performance problem when wrapping matchers. Fixes #24
What
Removed the destructuring assignment from inside the wrapMathcers() loop that was significantly slowing down tests when using this library.
Why
Fixes #24 - create and return a single object instead of creating a new object and re-copying all previous properties on every iteration of the loop.
The destructuring code was accidentally quadratic to the number of matcher properties. This changes it back to linear to the number of matchers.
Notes
No functional changes, just quicker :)
Housekeeping
- [x] Unit tests - no extra tests needed
- [x] Documentation is up to date - no change to documentation needed
- [x] No additional lint warnings
Any chance that we can get this merged @mattphillips 🙏 ?
Any reason this has been delayed in merging?
Thanks for this PR. I have a relatively large project with a lot of tests. The time to run the tests went down from ~55 seconds to ~35 changes. I copied this PR and merged it to my fork. I'll include it in version 1.1.0 of jest-27-expect-message https://github.com/HumbertoL/jest-expect-message/pull/1
Thanks @Coridyn sorry for the delay in getting this merged!