Back in the days CreateResponse was allowed to return undefined, signifying that the user had not properly setup a matcher for the intercepted request. In that case the algorithmic component knew to handle the case and pretty-print instructions for fixing it. In the big monocle-ts refactoring, the response creator was changed to throw an exception if no match was found. As no-one's even noticed that the logic has changed and no pretty-printing is done, I think we can simplify CreateResponse to just return ISerializedResponse or throw.
Back in the days
CreateResponse
was allowed to returnundefined
, signifying that the user had not properly setup a matcher for the intercepted request. In that case the algorithmic component knew to handle the case and pretty-print instructions for fixing it. In the bigmonocle-ts
refactoring, the response creator was changed to throw an exception if no match was found. As no-one's even noticed that the logic has changed and no pretty-printing is done, I think we can simplifyCreateResponse
to just returnISerializedResponse
or throw.