相关疑难解决方法(0)

伊斯坦布尔纽约公司排除测试文件

我目前正在最后的报道中获取我的测试文件.这可能是因为它们与我的组件并排放置,而不是拥有自己的测试文件夹.如何从保险范围中排除这些?

我安装了伊斯坦布尔纽约,我正在使用摩卡咖啡.

我的脚本看起来像:

"test": "nyc --reporter=html mocha tools/testSetup.js app/**/*.spec.js || true"

unit-testing mocha.js istanbul

14
推荐指数
1
解决办法
5492
查看次数

获取nyc/istanbul覆盖率报告以使用打字稿

我正在努力为我的打字稿/ mocha/gulp项目获得适当的nyc/istanbul报道.我尝试了很多方法,其中一些似乎无法使用源映射,而其他方法由于ts-node/ tsc错误而失败.我目前的设置是:

nyc 相关配置 package.json

"scripts": {
    "test:coverage": "nyc npm run test:unit",
    "test:unit": "gulp mocha"
}
"nyc": {
    "check-coverage": true,
    "all": true,
    "extension": [
      ".js",
      ".jsx",
      ".ts",
      ".tsx"
    ],
    "include": [
      "src/**/!(*.test.*).[tj]s?(x)"
    ],
    "reporter": [
      "html",
      "lcov",
      "text",
      "text-summary"
    ],
    "report-dir": "docs/reports/coverage"
  }
Run Code Online (Sandbox Code Playgroud)

gulpfile.js mocha 相关部分

const SRC_DIR = path.join(__dirname, 'src');
const SRC_FILES = path.join(SRC_DIR, '**', '*.[jt]s?(x)');
const TEST_FILES = path.join(SRC_DIR, '**', '*.test.[jt]s?(x)');
const MOCHA_CONFIG = {
    src: [
        TEST_FILES
    ],
    watchSrc: [
        SRC_FILES,
        TEST_FILES
    ], …
Run Code Online (Sandbox Code Playgroud)

javascript mocha.js typescript istanbul tsconfig

10
推荐指数
1
解决办法
4550
查看次数