refactor(cloudfunc) formatMsg: name default value

This commit is contained in:
coderaiser 2017-07-26 11:58:38 +03:00
parent 99d8487b29
commit cf36456303
2 changed files with 23 additions and 2 deletions

View file

@ -122,3 +122,25 @@ test('render', (t) => {
});
});
test('cloudfunc: formatMsg', (t) => {
const msg = 'hello';
const name = 'name';
const status = 'ok';
const result = CloudFunc.formatMsg(msg, name, status);
t.equal(result, 'hello: ok("name")');
t.end();
});
test('cloudfunc: formatMsg', (t) => {
const msg = 'hello';
const name = null;
const status = 'ok';
const result = CloudFunc.formatMsg(msg, name, status);
t.equal(result, 'hello: ok');
t.end();
});