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.

How to actually deal with promises?

See original GitHub issue

This is probably a duplicate of https://github.com/cartant/rxjs-marbles/issues/11, but the original issue never contained a valid example of a workaround for the issue with Promises.

And it would be really helpful if the library supported Promises out of the box.

Because right now I’m in a situation where after a code refactoring I cannot continue using rxjs-marbles in testing my Angular ngrx effect, because it consumes a service that returns a promise.

Any help appreciated.

Thanks

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cartantcommented, Apr 1, 2020

Nope. You cannot use hot and cold without the TestScheduler and virtual time. Use subjects for hot observables and of for cold, etc.

1reaction
Maximaximumcommented, Apr 1, 2020

I’ll just leave a link to the rxjs Known issues here, so that anyone scratching their head around these issues can easily find it: https://rxjs.dev/guide/testing/marble-testing#known-issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using promises - JavaScript - MDN Web Docs
A Promise is an object representing the eventual completion or failure of an ... The first mistake is to not chain things together...
Read more >
Dealing with Promises in JavaScript | by Travis Waith-Mair
Promises are Javascript global objects that have benefited the community in a couple of very important ways. First, It standardized the way we ......
Read more >
8 Ways to Actually Deliver on Your Promises - Lifehack
8 Ways to Actually Deliver on Your Promises · 1. Don't over-promise · 2. Deliver well · 3. Remember! · 4. Be cautious...
Read more >
6 Ways to Use Promises in Your Javascript Code
6 Ways to Use Promises in Your Javascript Code · 1. Create a new Promise · 2. Static methods · 3. Then and...
Read more >
JavaScript Promise Tutorial – How to Resolve or Reject ...
How to handle a Promise once you've created it. A Promise uses an executor function to complete a task (mostly asynchronously). A consumer ......
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