Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Stryker Jest runner with config workarounds #208

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 12 additions & 9 deletions jest.config.js
Expand Up @@ -143,21 +143,24 @@ module.exports = {
// Adds a location field to test results
// testLocationInResults: false,

// TBD ENABLED to work with Stryker Jest runner:
// The glob patterns Jest uses to detect test files
// testMatch: [
// "**/__tests__/**/*.[jt]s?(x)",
// "**/?(*.)+(spec|test).[tj]s?(x)"
// ],
testMatch: [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[tj]s?(x)"
],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
testPathIgnorePatterns: [
// "/node_modules/"
// ],
"/test/test.js"
],

// TBD NOT WORKING with Stryker Jest runner:
// The regexp pattern or array of patterns that Jest uses to detect test files
testRegex: [
/\.test\.js?$/
],
// testRegex: [
// /\.test\.js?$/
// ],

// This option allows the use of a custom results processor
// testResultsProcessor: undefined,
Expand Down
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -38,7 +38,8 @@
},
"dependencies": {},
"devDependencies": {
"@stryker-mutator/core": "^4.5.1",
"@stryker-mutator/core": "4.5.1",
"@stryker-mutator/jest-runner": "4.5.1",
"dom-js": "0.0.9",
"eslint": "^7.24.0",
"eslint-config-prettier": "^8.2.0",
Expand Down
7 changes: 2 additions & 5 deletions stryker.conf.json
Expand Up @@ -7,15 +7,12 @@
"progress",
"dashboard"
],
"testRunner": "command",
"testRunner": "jest",
"coverageAnalysis": "perTest",
brodybits marked this conversation as resolved.
Show resolved Hide resolved
"dashboard": {
"project": "github.com/brodybits/xmldom",
"version": "master"
},
"coverageAnalysis": "off",
"commandRunner": {
"command": "npm run test:jest -- --bail --no-cache --ci --maxWorkers=1"
},
"timeoutMS_comment": "When all tests pass (mutant survives) our tests need some time. So this is configured to prevent 'timeout's",
"timeoutMS": 15000
}