feature(cloudcmd) IO.cp -> IO.copy

This commit is contained in:
coderaiser 2020-08-14 17:13:27 +03:00
parent 13307f3861
commit 5041930685
9 changed files with 48 additions and 11 deletions

View file

@ -19,25 +19,25 @@ const {request} = require('serve-once')(cloudcmd, {
configManager,
});
test('cloudcmd: rest: cp', async (t) => {
test('cloudcmd: rest: copy', async (t) => {
const tmp = join(fixtureDir, 'tmp');
const files = {
from: '/fixture/',
to: '/fixture/tmp',
names: [
'cp.txt',
'copy.txt',
],
};
mkdirSync(tmp);
const {body} = await request.put(`/api/v1/cp`, {
const {body} = await request.put(`/api/v1/copy`, {
body: files,
});
rimraf.sync(tmp);
t.equal(body, 'copy: ok("["cp.txt"]")', 'should return result');
t.equal(body, 'copy: ok("["copy.txt"]")', 'should return result');
t.end();
});