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
expect.extend({toBe1(received){constpass=received===1;returnpass
? { pass,message: ()=>`expected ${received} to be 1`}
: { pass,message: ()=>`expected ${received} not to be 1`};}});expect.extend({toBe2(received){constpass=received===2;returnpass
? { pass,message: ()=>`expected ${received} to be 2`}
: { pass,message: ()=>`expected ${received} not to be 2`};}});console.log(expect['toBe1'],expect['toBe2']);// [Function (anonymous)] undefined
What happened (please provide anything you think will help):
Thanks for the library!
Bug
package
version: v1.1.3node
version: 14.21.3npm
(oryarn
) version: 6.14.18jest
version: 26.6.2Relevant code or config
What happened (please provide anything you think will help):
Thanks for the library!
The problem is at https://github.com/mattphillips/jest-expect-message/blob/main/src/withMessage.js#L92.
expectProxy = Object.assign(expectProxy, expect);
overwritesexpectProxy.extend
withexpect.extend
.It could be fixed by changing the line to:
The text was updated successfully, but these errors were encountered: