Closed ricky-kiva closed 6 months ago
Some tests related to database operation over API could fail erratically. In my case, a specific note can be viewed test failed. This happened because .forEach expects a synchronous function.
a specific note can be viewed
.forEach
Reference: https://betterprogramming.pub/javascript-async-await-pitfalls-with-foreach-d55dddc42d0
Turns out, it's already explained that .forEach won't work within beforeEach() in the later part.
beforeEach()
Some tests related to database operation over API could fail erratically. In my case,
a specific note can be viewed
test failed. This happened because.forEach
expects a synchronous function.Reference: https://betterprogramming.pub/javascript-async-await-pitfalls-with-foreach-d55dddc42d0