Skip to content

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

@akaigyouhou

Description

@akaigyouhou

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions