【问题标题】:Stryker Mutation testing setup in Windows is not running testsWindows 中的 Stryker Mutation 测试设置未运行测试
【发布时间】:2021-02-21 05:26:36
【问题描述】:

我在 React 应用程序中使用 Stryker 进行突变测试 当我运行命令npx stryker run 时出现以下错误 我能够生成 Stryker 报告 但是当我更新测试用例时无法生成更新的报告。

$ npx stryker run
12:41:27 (18244) INFO ConfigReader Using stryker.conf.js
12:41:28 (18244) INFO InputFileResolver Found 17 of 142 file(s) to be mutated.
12:41:28 (18244) INFO Instrumenter Instrumented 17 source file(s) with 932 mutant(s)
12:41:28 (18244) INFO ConcurrencyTokenProvider Creating 6 checker process(es) and 5 test runner process(es).
12:41:47 (18244) INFO DryRunExecutor Starting initial test run. This may take a while.
12:41:48 (18244) INFO DryRunExecutor Initial test run succeeded. Ran 0 tests in 1 second (net 0 ms, overhead 1130 ms).

12:41:48 (18244) ERROR Stryker No tests were executed. Stryker will exit prematurely. Please check your configuration.

我的 Stryker 配置文件:

 * @type {import('@stryker-mutator/api/core').StrykerOptions}
 * @type {import('@stryker-mutator/typescript-checker').StrykerOptions}
 */
module.exports = {
  _comment:
    "This config was generated using 'stryker init'. Please see the guide for more information: https://stryker-mutator.io/docs/stryker/guides/react",
  testRunner: 'jest',
  mutate: [
    'src/index.js',
    'src/App.js',
  ],
  reporters: ['progress', 'clear-text', 'html'],
  coverageAnalysis: 'off',
  jest: {
    projectType: 'create-react-app',
  },
  checkers: ['typescript'],
  tsconfigFile: 'tsconfig.json',
}; ````


  [1]: https://i.stack.imgur.com/Hs8Tq.png

【问题讨论】:

    标签: javascript reactjs stryker


    【解决方案1】:

    通过在 stryker.config.js 文件中添加以下内容解决了该问题

    tempDirName: 'strykerTmp',

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-02
      • 2017-10-31
      • 2023-03-24
      • 2016-09-02
      • 2023-04-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多