You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like to assert that an endpoint has been called with a given payload at a certain point in time.
👀 Example
wrap(App).withNetwork([path: '/users/1/update/',requestBody: {name: 'Alexander',surname: 'Nevsky'},]).mount()awaitstartSomeFlow()awaitupdateUser()// Let's suppose that in this page we update the user dataawaitdoSomethingElse()awaitupdateUserAgain()// At the end we update the user againexpect('/users/1/update/').toHaveBeenNthFetchedWith(1,{name: 'Alexander',surname: 'Nevsky',})// We want to assert that the first time this endpoint was called, the payload was this one.
💬 Comments
We had a situation within acmofy-app that required this.
The text was updated successfully, but these errors were encountered:
:notbad: it would be very useful sometimes… maybe the naming is what confuses me a bit more but I have no better alternative to propose so 🤐 (I thought something with "at" but it doesn't work)
✨ Feature proposal
Add
toHaveBeenNthFetchedWith
.🎯 Motivation
We would like to assert that an endpoint has been called with a given payload at a certain point in time.
👀 Example
💬 Comments
We had a situation within
acmofy-app
that required this.The text was updated successfully, but these errors were encountered: