chore(cloudcmd) update dependencies

This commit is contained in:
coderaiser 2020-12-04 18:47:24 +02:00
parent 4c7f8cc6b6
commit c719e37cc1
5 changed files with 37 additions and 21 deletions

View file

@ -1,6 +1,7 @@
'use strict';
const fs = require('fs');
const tryCatch = require('try-catch');
const DIR = __dirname + '/../../';
const COMMONDIR = DIR + 'common/';
@ -181,16 +182,18 @@ test('cloudfunc: getHeaderField', (t) => {
});
test('cloudfunc: getPathLink: no url', (t) => {
t.throws(CloudFunc.getPathLink, 'should throw when no url');
const [error] = tryCatch(CloudFunc.getPathLink);
t.ok(error, 'should throw when no url');
t.end();
});
test('cloudfunc: getPathLink: no template', (t) => {
const url = 'http://abc.com';
const prefix = '';
const fn = () => CloudFunc.getPathLink(url, prefix);
const [error] = tryCatch(CloudFunc.getPathLink, url, prefix);
t.throws(fn, 'should throw when no template');
t.ok(error, 'should throw when no template');
t.end();
});