shmock icon indicating copy to clipboard operation
shmock copied to clipboard

Request forwarding to wait callback

Open emidiocroci opened this issue 11 years ago • 2 comments

I used shmock to mock requests to a legacy library during some integration tests and I needed to inspect the received request in order to get the value of some parameters contained in the body, so I decided to forward it in the wait callback. I should be useful for an advanced inspection of the received request.

emidiocroci avatar Sep 17 '14 11:09 emidiocroci

Maybe I'm misunderstanding you, but can't you do it with .send()

https://github.com/xetorthio/shmock#on-request-body

tinchogob avatar Sep 17 '14 12:09 tinchogob

From what I understood, .send() is used to tell shmock what parameters it should expect in the request but I need to know what are the received parameters (not if they are equal to something else). More precisely, I was mocking an authentication request and I needed to know what was the username sent to the library.

emidiocroci avatar Sep 17 '14 12:09 emidiocroci