为了账号安全,请及时绑定邮箱和手机立即绑定

伊斯坦布尔代码覆盖率 - 如果未采用路径

伊斯坦布尔代码覆盖率 - 如果未采用路径

慕沐林林 2021-08-20 14:25:00
以下是查找随附的伊斯坦布尔覆盖率报告的函数。export function getControlFromId(controlId, ancestorControl) {  if (!(controlId && ancestorControl)) {    return undefined;  }  if (controlId === ancestorControl.id) {    return ancestorControl;  }  if (ancestorControl.controls) {    for (const control of ancestorControl.controls) {      const result = getControlFromId(controlId, control);      if (result) {        return result;      }    }  }  return undefined;}
查看完整描述

1 回答

?
绝地无双

TA贡献1946条经验 获得超4个赞

问题:为什么它说 if-path 没有被采用?该图像清楚地显示了 if 循环中的行。


样本测试数据:


const ancestorControl = {

        name: 'form',

        controls: [

          {

            name: 'Section',

            id: 1,

          },

        ],

      };


查看完整回答
反对 回复 2021-08-20
  • 1 回答
  • 0 关注
  • 144 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信