ctimmerm / axios-mock-adapter

Axios adapter that allows to easily mock requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use Promise in mocked data

fdrobidoux opened this issue · comments

I made the mistake of doing this, and it cost me a bunch of time :

mockAxiosAdapter.onGet("/groups")
    .replyOnce(200, Promise.resolve(groups));

Could it be possible to resolve Promises in the transformRequest(data) function in handle_request.js?

Thanks!

why you don't await the promises before and add to the mock just the returned data?