Add skip functionality
See original GitHub issueSometimes 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:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
, orExpected 5 items, but got 4 and Error
. That’s the kind of logic that I wouldn’t want to repeat in all my tests.Will open a PR on the weekend, so it will be easier to have a base for further discussions.