mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
25 lines
538 B
JavaScript
25 lines
538 B
JavaScript
import test from 'supertape';
|
|
import stub from '@cloudcmd/stub';
|
|
import mockRequire from 'mock-require';
|
|
|
|
const {reRequire} = mockRequire;
|
|
|
|
test('client: dom: io', (t) => {
|
|
const sendRequest = stub();
|
|
mockRequire('./send-request', sendRequest);
|
|
|
|
const io = reRequire('.');
|
|
|
|
io.createDirectory('/hello');
|
|
|
|
const expected = {
|
|
imgPosition: {
|
|
top: true,
|
|
},
|
|
method: 'PUT',
|
|
url: '/fs/hello?dir',
|
|
};
|
|
|
|
t.calledWith(sendRequest, [expected]);
|
|
t.end();
|
|
});
|