我正在尝试为我的应用程序做突变测试,但是当我运行我的stryker mutator时,它不会将任何测试带入分析中,而是执行预演。
WARN InputFileResolver Glob pattern "src/**/*.ts" did not result in any files.
(10452) WARN InputFileResolver Glob pattern "!src/**/*.spec.ts" did not exclude any files.
(10452) WARN InputFileResolver Glob pattern "!src/test.ts" did not exclude any files.
(10452) WARN InputFileResolver Glob pattern "!src/environments/*.ts" did not exclude any files.
(10452) WARN InputFileResolver No files marked to be mutated, Stryker will perform a dry-run without actually mutating anything. You can configure the `mutate` property in your config file (or use `--mutate` via command line)如你所见,我已经正确地声明了我的glob模式,但下面是完整的stryker配置:
/**
* @type {import('@stryker-mutator/api/core').StrykerOptions}
*/
module.exports = {
_comment:
"This config was generated using 'stryker init'. Please see the guide for more information: https://stryker-mutator.io/docs/stryker-js/guides/angular",
mutate: [
"src/**/*.ts",
"!=src/**/*.spec.ts",
"!src/test.ts",
"!src/environments/*.ts",
],
testRunner: "jest",
"jest": {
"projectType": "custom",
"configFile": "jest.config.js",
"config": {
"testEnvironment": "jest-environment-jsdom-sixteen"
},
"enableFindRelatedTests": true,
},
reporters: ["progress", "clear-text", "html"],
concurrency: 4,
concurrency_comment:
"Recommended to use about half of your available cores when running stryker with angular",
coverageAnalysis: "perTest",
};发布于 2021-06-18 21:57:30
这是我的配置文件,它可以提取我的测试。我使用的是最新版本。
/**
* @type {import('@stryker-mutator/api/core').StrykerOptions}
*/
module.exports = {
coverageAnalysis: 'off',
packageManager: 'npm',
reporters: ['html', 'clear-text', 'progress'],
htmlReporter: {
baseDir: 'docs/mutation'
},
testRunner: 'jest',
mutate: [
'src/**/*.ts',
'src/**/*.service.ts',
'!src/**/*.interface.ts',
'!src/**/*.fake.ts',
'!src/**/*.mock.ts',
'!src/**/*.spec.ts',
'!src/**/__mocks__/*',
'!src/main.ts'
],
timeoutMS: 30000 // Use extended timeoutMs for test run to remove Time Out Results
};https://stackoverflow.com/questions/68030269
复制相似问题