Unexpected-mXHR Plugin for Unexpected that allows mocking browser based XHR requests using the same declarative syntax as unexpected-mitm. Read the documentation.