mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test(cloudfunc) getPathLink
This commit is contained in:
parent
b695420114
commit
7cb681f293
2 changed files with 15 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ module.exports.apiURL = '/api/v1';
|
|||
module.exports.MAX_FILE_SIZE = 500 * 1024;
|
||||
module.exports.Entity = Entity;
|
||||
module.exports.getHeaderField = getHeaderField;
|
||||
module.exports.getPathLink = getPathLink;
|
||||
|
||||
module.exports.formatMsg = (msg, name, status) => {
|
||||
status = status || 'ok';
|
||||
|
|
|
|||
|
|
@ -199,3 +199,17 @@ test('cloudfunc: getHeaderField', (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudfunc: getPathLink: no url', (t) => {
|
||||
t.throws(CloudFunc.getPathLink, '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);
|
||||
|
||||
t.throws(fn, 'should throw when no template');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue