'when' methods
when(method, url, [data], [headers]) Creates a new backend definition
|
whenGET(url, [headers]) Create backend definition for GET request
|
whenHEAD(url, [headers]) Create backend definition for HEAD request
|
whenDELETE(url, [headers]) Create backend definition for DELETE request
|
whenPOST(url, [data], [headers]) Create backend definition for POST request
|
whenPUT(url, [data], [headers]) Create backend definition for PUT request
|
whenPATCH(url, [data], [headers]) Create backend definition for PATCH request
|
whenJSONP(url) Create backend definition for JSONP request
|
Additional methods
flush([count]) Flushes all pending requests using trained responses
|
resetExpectations() Resets all request expectations, but preserves all backend definitions. (Wipe expect
, but keep when
)
|
|
|
'expect' methods
expect(method, url, [data], [headers]) Creates a request expectation
|
expectGET(url, [headers]) Create request expectation for GET request
|
expectHEAD(url, [headers]) Create request expectation for HEAD request
|
expectDELETE(url, [headers]) Create request expectation for DELETE request
|
expectPOST(url, [data], [headers]) Create request expectation for POST request
|
expectPUT(url, [data], [headers]) Create request expectation for PUT request
|
expectPATCH(url, [data], [headers]) Create request expectation for PATCH request
|
expectJSONP(url) Create request expectation for JSONP request
|
Additional expectations
verifyNoOutstandingExpectation() Verifies that all of the requests defined via the expect
api were made.
|
verifyNoOutstandingRequest() Verifies that there are no outstanding requests that need to be flushed
|
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by CITguy