egg应用,某个函数如下:
function abc(arg) {
assert(typeof arg === 'string', 'arg should be a string');
// do other thing
// ...}如果传参为非string类型,会触发assert语句,控制台报错。测试用例中,怎么写控制台才不会报错呢?
it('should call abc(1) fail', () => {
// how
});HUWWW
扬帆大鱼
相关分类