diff --git a/jest.config.js b/jest.config.js index a5bc07829..c72c793ef 100644 --- a/jest.config.js +++ b/jest.config.js @@ -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, diff --git a/package-lock.json b/package-lock.json index 09264fe00..45ec9b15a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -864,6 +864,18 @@ "weapon-regex": "~0.4.1" } }, + "@stryker-mutator/jest-runner": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@stryker-mutator/jest-runner/-/jest-runner-4.5.1.tgz", + "integrity": "sha512-ei0YWdf3tjShChvU5cBBET3Eqa3PfshcfHxAG/RgYgrfZYGHL1GnT5dsGLojf4b5TEPY12Q9HVkSnsnoFvW5mQ==", + "dev": true, + "requires": { + "@stryker-mutator/api": "4.5.1", + "@stryker-mutator/util": "4.5.1", + "semver": "~6.3.0", + "tslib": "~2.1.0" + } + }, "@stryker-mutator/util": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/@stryker-mutator/util/-/util-4.5.1.tgz", diff --git a/package.json b/package.json index ee395572b..18b1a7311 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/stryker.conf.json b/stryker.conf.json index 5fcbb873e..d92798974 100644 --- a/stryker.conf.json +++ b/stryker.conf.json @@ -7,15 +7,12 @@ "progress", "dashboard" ], - "testRunner": "command", + "testRunner": "jest", + "coverageAnalysis": "perTest", "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 }