执行代码覆盖时,我的所有.catch()语句都被发现,有没有办法在某处指定/ *伊斯坦布尔忽略下一个* /?
例如:
function list(req, res, next) {
const { limit = 50, skip = 0 } = req.query;
User.list({ limit, skip })
.then(users => res.json(users))
.catch(e => next(e)); <= this line is marked as uncovered
}
是的,只需更改.catch(e => next(e));
为
.catch(
/* istanbul ignore next */
(e) => {
next(e);
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句