mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
refactor(cloudfunc) buildFromJSON: getDotDot
This commit is contained in:
parent
7cb681f293
commit
9dd993fe3f
2 changed files with 30 additions and 6 deletions
|
|
@ -213,3 +213,18 @@ test('cloudfunc: getPathLink: no template', (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudfunc: getDotDot', (t) => {
|
||||
const dotDot = CloudFunc.getDotDot('/home');
|
||||
|
||||
t.equal(dotDot, '/', 'should return root');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('cloudfunc: getDotDot: two levels deep', (t) => {
|
||||
const dotDot = CloudFunc.getDotDot('/home/coderaiser/');
|
||||
console.log(dotDot);
|
||||
|
||||
t.equal(dotDot, '/home', 'should return up level');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue