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
constobj={};for(leti=0;i<100000;i++){obj[`_${i}`]=i;}it('is an object',()=>{expect(obj).toBeObject();});
This test takes approx 7 seconds to complete. NB that's 7 secs just to run the expectation, not including building the object.
Reason is that toBeObject creates both the pass and fail messages even if the test passes. This includes calling printReceived() on the input, and when the input is large, this takes a long time.
Neither message is used when the test passes, so this is unnecessary.
Pretty much all the other matchers are affected by the same issue.
I will submit a PR to fix this.
The text was updated successfully, but these errors were encountered:
Bug
package
version: 3.2.0node
version: 16.18.1npm
version: 8.19.2Relevant code or config:
This test takes approx 7 seconds to complete. NB that's 7 secs just to run the expectation, not including building the object.
Reason is that
toBeObject
creates both the pass and fail messages even if the test passes. This includes callingprintReceived()
on the input, and when the input is large, this takes a long time.Neither message is used when the test passes, so this is unnecessary.
Pretty much all the other matchers are affected by the same issue.
I will submit a PR to fix this.
The text was updated successfully, but these errors were encountered: