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.

Add skip functionality

See original GitHub issue

Sometimes it might be good to have a way to skip a certain number of events to have a cleaner test without multiple await calls, which are then not part of any assertion. For my codebase I added an extension function like this:

suspend fun <T> FlowTurbine<T>.skipItem(amount: Int = 1) = repeat(amount) {
    awaitItem()
}

Does it make sense to add that functionality on library level?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mattpreciouscommented, Mar 30, 2022

I think to make it a worthwhile addition over repeat(5) { awaitItem() }, there should be a helpful error message when it fails. Ex: Expected 5 items, but got 4, or Expected 5 items, but got 4 and Error. That’s the kind of logic that I wouldn’t want to repeat in all my tests.

0reactions
JohannesPtaszykcommented, Mar 30, 2022

Will open a PR on the weekend, so it will be easier to have a base for further discussions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Skip Functions? - python
if stocklevel < 1 I want to skip all the code you have put underneath it, not run through it. – user6275319 ·...
Read more >
How to Create a “Skip to Content” Link
Another nice thing you can do with skip links is to provide them before sections of content that contain lots of interactive items,...
Read more >
How to Add a "Skip to Main Content" Link to Your Website
To test it, navigate to a11yproject.com and hit the Tab key. The skip-to-main-content link immediately becomes visible. After that, you can hit ...
Read more >
Skip Navigation Links
Skip navigation links are useful to give screen reader and keyboard users the same capability of navigating directly to the main content.
Read more >
How to add “Skip to stage” functionality to workflow
1. Create a variable of Boolean type with the name “IncludeThisStage”: click “Local Variables” on the Ribbon and add a new variable. ·...
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