mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore(cloudcmd) update dependencies
This commit is contained in:
parent
4c7f8cc6b6
commit
c719e37cc1
5 changed files with 37 additions and 21 deletions
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
const test = require('supertape');
|
||||
const {reRequire} = require('mock-require');
|
||||
const tryCatch = require('try-catch');
|
||||
const Util = require('./util');
|
||||
|
||||
const {
|
||||
findObjByNameInArr,
|
||||
getRegExp,
|
||||
|
|
@ -35,13 +37,16 @@ test('util: getExt: no name', (t) => {
|
|||
});
|
||||
|
||||
test('util: findObjByNameInArr: no array', (t) => {
|
||||
t.throws(findObjByNameInArr, /array should be array!/, 'should throw when no array');
|
||||
const [error] = tryCatch(findObjByNameInArr);
|
||||
|
||||
t.equal(error.message, 'array should be array!', 'should throw when no array');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('util: findObjByNameInArr: no name', (t) => {
|
||||
const fn = () => findObjByNameInArr([]);
|
||||
t.throws(fn, /name should be string!/, 'should throw when no name');
|
||||
const [error] = tryCatch(findObjByNameInArr, []);
|
||||
|
||||
t.equal(error.message, 'name should be string!', 'should throw when no array');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue