testing-javascript-applications icon indicating copy to clipboard operation
testing-javascript-applications copied to clipboard

Missing async/await in chapter6/5_web_sockets_and_http_requests/1_http_request

Open akaigyouhou opened this issue 3 years ago • 0 comments

I think there maybe some problem after you add fetch in addItem function in inventoryController.js for tests involving HTTP requests. I got the error that the nock mock is not received request. And finally I think the problem is because you add a fetch in addItem function, but forgot to change the function to some async/await. But here is a problem, if you change the addItem function to async/await, the main.test.js will also be broken. And I am also not sure whether it's necessary to write some loop to to catch the fireEvent result after change the addItem function.

akaigyouhou avatar Jul 26 '22 13:07 akaigyouhou