From 26d1bf09fd7e1c2663ad761b67dda9d1262edf5a Mon Sep 17 00:00:00 2001 From: Pan Date: Mon, 1 Apr 2019 17:37:37 +0800 Subject: [PATCH] fix[Mock]: fixed mock bug --- mock/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mock/index.js b/mock/index.js index 15e07afa..7d9609ab 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,7 +11,10 @@ export function mockXHR() { Mock.XHR.prototype.send = function() { if (this.custom.xhr) { this.custom.xhr.withCredentials = this.withCredentials || false - this.custom.xhr.responseType = this.responseType + + if (this.responseType) { + this.custom.xhr.responseType = this.responseType + } } this.proxy_send(...arguments) }