尝试运行 stryker 时出错

Getting errors while trying to run stryker

提问人:ptjr 提问时间:2/10/2023 更新时间:2/10/2023 访问量:185

问:

尝试运行 stryker 时出现以下错误:


Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

By default "node_modules" folder is ignored by transformers.

Details:

C:\....newproject\.stryker-tmp\sandbox9266690\src\App.css:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){.App {
                                                                                  ^
SyntaxError: Unexpected token '.'
..........

这是我的 stryker.conf.mjs 文件:

/** @type {import('@stryker-mutator/api/core').PartialStrykerOptions} */
const config = {
  mutate: ["src/components/Home.js"],
  _comment:
    "This config was generated using 'stryker init'. Please take a look at: https://stryker-mutator.io/docs/stryker-js/configuration/ for more information.",
  packageManager: "npm",
  reporters: ["html", "clear-text", "progress"],
  testRunner: "jest",
  testRunner_comment:
    "Take a look at https://stryker-mutator.io/docs/stryker-js/jest-runner for information about the jest plugin.",
  coverageAnalysis: "off",
};
export default config;

我想如果我将我的 Home.js 文件指定为突变体,那么 stryker 只会运行这个文件,但似乎它与其他 .css 文件有一些问题。 谁能帮我解决这个问题?

JavaScript jestjs 突变测试 stryker

评论


答: 暂无答案