ant-design/components/upload/__tests__/mock.js

16 lines
281 B
JavaScript
Raw Normal View History

2018-05-31 22:37:09 +08:00
import mock from 'xhr-mock';
export function setup() {
mock.setup();
mock.post('http://upload.com/', (req, res) => {
req.headers({
'content-length': 100,
});
req.body('thisisbody');
return res;
});
}
export const teardown = mock.teardown.bind(mock);