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
{{ message }}
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.
it('should support mock override with respond',async()=>{
If we defined mocks for calls to /A, /B, /C, yesno will try to match those 3 mocks in order of API calls made. If the 2nd API call, for example, isn't to /B it will error.
A user then adds matching('/X').respond() in addition to the mocks for A, B, C above. If the user then has API calls in this order: A, B, X, C
They will encounter an error on the call to C b/c in fact X has replaced C so C mock will no longer exist.
See
yesno/test/unit/yesno.spec.ts
Line 660 in bac495a
If we defined mocks for calls to
/A
,/B
,/C
, yesno will try to match those 3 mocks in order of API calls made. If the 2nd API call, for example, isn't to/B
it will error.A user then adds
matching('/X').respond()
in addition to the mocks forA, B, C
above. If the user then has API calls in this order:A, B, X, C
They will encounter an error on the call to
C
b/c in factX
has replacedC
soC
mock will no longer exist.In fact to get this to work I would have to:
,
/B`, `/DUMMY_TO_GET_CLOBBERED`, /C`.matching('/X').respond()
A, B, X, C
No proposed updated API here. For now I just wanted to note this behavior and consider if it's what we want.
The text was updated successfully, but these errors were encountered: