question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue when using expect.not

See original GitHub issue

I am experiencing a strange behavior using expect.not, which may be a bug. not seems not to defined on the expect 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:

Jest v22.1.2 node v7.4.0 linux/amd64
   
 FAIL  ./not-test.js
  not.stringContaining
    ✕ matches if the actual string does not contain the expected substring (7ms)

  ● not.stringContaining › matches if the actual string does not contain the expected substring

    TypeError: Cannot read property 'stringContaining' of undefined

      3 | 
      4 |   it('matches if the actual string does not contain the expected substring', () => {
    > 5 |     expect('How are you?').toEqual(expect.not.stringContaining(expected));
      6 |   });
      7 | });
      
      at Object.it (not-test.js:5:46)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        0.913s
Ran all test suites.
exit status 1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
mattphillipscommented, Mar 21, 2018

@SimenB I’m working on a PR to fix this now

0reactions
github-actions[bot]commented, May 12, 2021

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. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

linux - Expect - does not send text as desired - Stack Overflow
the cursor is located below the text and in the line below. I am not sure if this has to do anything with...
Read more >
Expect script is not working on linux machine
Same thing I am trying through expect script and it throws me error as below. ./expectscriptssh.sh 192.168.1.177 spawn ssh root@192.168.1.177 ...
Read more >
1. Intro—What Is Expect? - Exploring Expect [Book] - O'Reilly
A more serious problem occurs when dealing with programs that change the way they buffer output depending on whether they are running interactively...
Read more >
expect(1) - Linux man page
Expect is a program that "talks" to other interactive programs according to a script. Following the script, Expect knows what can be expected...
Read more >
Failed attempt to expect and send in an expect script in MinGW
You don't have expect installed on your system. If the error is this: bash: expect: command not found. To confirm, try using which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found