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.

Error: This promise must be present when running with -o

See original GitHub issue

Environment

  1. node -v: v8.1.0 or v6.10.2

  2. npm -v: 5.0.3 or v5.4.1

  3. npm ls react-scripts (if you haven’t ejected): (empty)

  4. Operating system: MacOS Sierra 10.12.6

  5. Jest version: v21.1.0

  6. vscode-jest version: 2.3.0

Steps to Reproduce

  • Create an empty project.
  • Install locally Jest v21.1.0
  • Creater some.spec.js that just asserts true equals true
  • Restart VS Code
  • Go to Jest output, it shows this:
Error: This promise must be present when running with -o.
    at /Project/node_modules/jest/node_modules/jest-cli/build/search_source.js:203:17
    at Generator.next (<anonymous>)
    at step (/Project/node_modules/jest/node_modules/jest-cli/build/search_source.js:20:362)
    at /Project/node_modules/jest/node_modules/jest-cli/build/search_source.js:20:592
    at Promise (<anonymous>)
    at /Project/node_modules/jest/node_modules/jest-cli/build/search_source.js:20:273
    at SearchSource.getTestPaths (/Project/node_modules/jest/node_modules/jest-cli/build/search_source.js:217:10)
    at /Project/node_modules/jest/node_modules/jest-cli/build/run_jest.js:45:29
    at Generator.next (<anonymous>)
    at step (/Project/node_modules/jest/node_modules/jest-cli/build/run_jest.js:24:380)

Expected Behavior

Work. Like it does when using latest jest v20

Actual Behavior

Does not works, does nothing.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:18
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
sunshinejrcommented, Oct 8, 2017

@orta @drpicox I had the same issue. From this thread it seems like this is a problem whenever you don’t have git yet in the project. Indeed setting the watchAll instead of watch flag helped, but better yet I’ve just initialized git repo and it worked well (I would need to do this anyways). Dunno if it’s something you can fix on your end as they still have opened PRs, though.

1reaction
daniel-234commented, Nov 9, 2017

@sunshinejr, thanks for pointing at using the --watchAll flag. I experienced the same issue working on Windows 10 with Jest v21.2.1 and solved it that way. It seems to have been fixed in #4737 but not yet released.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest test fails when trying to test an asynchronous function ...
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not...
Read more >
Error handling with promises - The Modern JavaScript Tutorial
In case of an error, the promise becomes rejected, and the execution should jump to the closest rejection handler. But there is none....
Read more >
Mocha - the fun, simple, flexible JavaScript test framework
Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run...
Read more >
Troubleshooting - Jest
This will run Jest in a Node process that an external debugger can ... will give you a list of available node instances...
Read more >
Promise.reject() - JavaScript - MDN Web Docs
Promise.reject(new Error('fail')).then(resolved, rejected);. 10. // expected output: Error: fail. 11. ​. Run ›
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