We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca636db commit ae225dbCopy full SHA for ae225db
src/utils/faker.js
@@ -1,6 +1,7 @@
1
/* eslint-disable no-restricted-globals */
2
import { newMockXhr } from 'mock-xmlhttprequest';
3
import responseBuilder from './responseBuilder';
4
+import statusTextMap from './statusMap';
5
6
class Faker {
7
constructor() {
@@ -72,7 +73,8 @@ class Faker {
72
73
const { method, url } = xhr;
74
const matched = this.matchMock(url, method);
75
if (matched) {
- xhr.respond(matched.status || 200, {}, matched.response);
76
+ const status = matched.status || 200
77
+ xhr.respond(status, matched.headers, matched.response, statusTextMap[status]);
78
} else {
79
// eslint-disable-next-line new-cap
80
const realXhr = new self.realXMLHttpRequest();
0 commit comments