mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(cloudcmd) IO.cp -> IO.copy
This commit is contained in:
parent
13307f3861
commit
5041930685
9 changed files with 48 additions and 11 deletions
|
|
@ -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();
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue