Skip to content

it doesn't work inside forEach loop #24345

Discussion options

You must be logged in to vote

you are running into the asynchronicity issue. think of before() block as a part of your it() blocks. basically, the reason your tests aren’t running is because you are generating your tests using empty array. that array does not get filled until before() hook runs. but since before() hook is essentially a part of your it(), those tests will never get generated.

you can easily fix this issue by moving your allLinks.forEach() function inside your it() block

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@0618
Comment options

@Hexronimo
Comment options

Answer selected by emilyrohrbough
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants