-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when using expect.not #5848
Comments
@SimenB I'm working on a PR to fix this now |
PR welcome removing its mention from https://github.com/facebook/jest/tree/master/website/versioned_docs/version-22.4 |
Thank you! |
Imma call this fixed |
Any suggestions on what to use instead? =) |
I made this solution but am not particularly fond of it:
|
@gurbraj what do you mean? |
How the expression should look like for the Jest before 23.0.0? |
In case you are on a version < Example similar to the docs for describe('not.toEqual using `expect.stringContaining`', () => {
const expected = 'Hello world!';
it('matches if the actual string does not contain the expected substring', () => {
expect('How are you?').not.toEqual(expect.stringContaining(expected));
});
}); If anyone sees any issue with this, please let me know. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am experiencing a strange behavior using
expect.not
, which may be a bug.not
seems not to defined on theexpect
object anymore.I pasted a simple example from https://facebook.github.io/jest/docs/en/expect.html#expectnotstringcontainingstring
into a repl.it demo: https://repl.it/@holgergp/testing-not
The output of the test:
The text was updated successfully, but these errors were encountered: