From f843a0bffc4d9bc38d20739def856f844eb42fe9 Mon Sep 17 00:00:00 2001 From: hetech Date: Mon, 10 Jun 2019 14:20:11 +0800 Subject: [PATCH] Upload: fix type error in unit test (#15979) --- test/unit/specs/upload.spec.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/unit/specs/upload.spec.js b/test/unit/specs/upload.spec.js index 9550f0f46..834fcdbf7 100644 --- a/test/unit/specs/upload.spec.js +++ b/test/unit/specs/upload.spec.js @@ -1,13 +1,13 @@ import { createVue, destroyVM } from '../util.js'; import ajax from 'packages/upload/src/ajax'; -const noop = () => { -}; + +const noop = () => {}; const option = { onSuccess: noop, onProgress: noop, data: { a: 'abc', b: 'bcd' }, filename: 'file.png', - file: 'foo', + file: new File([JSON.stringify('foo')], {type: 'image/png'}), action: '/upload', headers: { region: 'shanghai' } }; @@ -35,7 +35,6 @@ describe('ajax', () => { it('request width header', done => { ajax(option); expect(requests[0].requestHeaders).to.eql({ - // 'X-Requested-With': 'XMLHttpRequest', region: 'shanghai' }); done();