refactor(cloudfunc) buildFromJSON: getDotDot

This commit is contained in:
coderaiser 2017-08-02 12:35:49 +03:00
parent 7cb681f293
commit 9dd993fe3f
2 changed files with 30 additions and 6 deletions

View file

@ -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();
});