'JEST: describe.each for asynchronous collection

I need to make tests for sync collection

Try it:

let collection = [];
beforeAll( async() => {  collection = await getAsyncCollection() }

describe.each(collection)("Test summary for collection", (item)=>{
     // ...  .each work with empty collection before than finish "befoerAll", which getting this collection, why?
    })

How do it right? And why each working before "beforeAll" ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source