禁用伊斯坦布尔进行Jest调试

问题描述 投票:0回答:1

我正在尝试调试用Jest编写的一些失败的测试。尽管可以,但附加上chrome调试器也很好,我注意到Istanbul显然已经在工作,并且使我的文件更难以使用。

有人知道是否有禁用伊斯坦布尔的方法,或者以某种方式使Node可以通过等效于映射文件的方式进行调试吗?

编辑这是我要调试的文件的示例。在源代码中,它称为handlerFactory.js,但在chrome中,当我从测试功能进入时,我最终调试了VM3376 handlerFactory.js文件。

/* istanbul ignore next */
cov_6n2doqihv.s[10]++;

const insertCheckins = postgres => {
  /* istanbul ignore next */
  cov_6n2doqihv.f[2]++;
  cov_6n2doqihv.s[11]++;
  return (
    /**
     * Function to insert the records
     * @param  {Object} checkIns The check-in records
     * @return {Promise}
     */
    async checkIns => {
      /* istanbul ignore next */
      cov_6n2doqihv.f[3]++;
      cov_6n2doqihv.s[12]++;
      return Promise.all(checkIns.map(checkin => {
        /* istanbul ignore next */
        cov_6n2doqihv.f[4]++;
        cov_6n2doqihv.s[13]++;
        return insertRecord(postgres)(checkin);
      }));
    }
  );
};
node.js jestjs istanbul
1个回答
0
投票

伊斯坦布尔默认情况下处于禁用状态,在package.jsonjest.config.js中的笑话配置中可能已启用它

要禁用它,您可以删除configuration

package.json
{
  "jest": {
-    "coverage": true
  }
}

或显式运行jest而没有覆盖范围

jest --coverage=false

要在VSCode中使用Nodejs调试器,可以查看the documentation或尝试使用this launch.json

© www.soinside.com 2019 - 2024. All rights reserved.