Answer the question
In order to leave comments, you need to log in
Jest: Describe.each for asynchronous collection?
It is necessary to make a set of tests for the collection received asynchronously.
I try like this:
let collection = [];
beforeAll( async() => { collection = await getAsyncCollection() }
describe.each(collection)("Test summary for collection", (item)=>{
// ... и вот сюда мы не попадаем, потому что сначала отрабатывает each на пустой коллекции, а потом уже beforeAll получает коллекци.
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question