From f660bc57afbc21e866061627fa4fe8443ef48ba8 Mon Sep 17 00:00:00 2001 From: Nico Jansen Date: Fri, 6 Apr 2018 13:18:43 +0200 Subject: [PATCH 1/3] feat(stryker-api): add stryker-api 0.15 support --- package.json | 14 +++++++------- stryker.conf.js | 22 +++++++++------------- test/integration/StrykerJestRunnerSpec.ts | 2 +- test/unit/JestTestRunnerSpec.ts | 2 +- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 824adfe..e3fd201 100644 --- a/package.json +++ b/package.json @@ -61,18 +61,18 @@ "react-scripts": "^1.0.17", "rimraf": "^2.6.2", "sinon": "^4.0.1", - "stryker": "^0.19.1", - "stryker-api": "^0.13.0", - "stryker-html-reporter": "^0.12.1", - "stryker-mocha-framework": "^0.8.3", - "stryker-mocha-runner": "^0.10.5", - "stryker-typescript": "^0.9.1", + "stryker": "^0.21.0", + "stryker-api": "^0.15.0", + "stryker-html-reporter": "^0.13.0", + "stryker-mocha-framework": "^0.9.0", + "stryker-mocha-runner": "^0.11.0", + "stryker-typescript": "^0.10.0", "tslib": "^1.8.1", "tslint": "^5.8.0", "typescript": "^2.5.0" }, "peerDependencies": { - "stryker-api": "^0.13.0", + "stryker-api": "0.13 - 0.15", "jest": "^20.0.0" }, "dependencies": { diff --git a/stryker.conf.js b/stryker.conf.js index 80bd7e0..161ef31 100644 --- a/stryker.conf.js +++ b/stryker.conf.js @@ -1,19 +1,15 @@ module.exports = function(config) { config.set({ - files: [ - '!src/**/*.ts', - - { pattern: 'src/**/*.ts', included: false, mutated: true }, - - // Exclude all .d.ts files - '!**/*.d.ts', - - // Exclude interface and index file - '!./src/configLoaders/JestConfiguration.ts', - '!./src/index.ts', - - '!./test/integration/**/*' + mutate: [ + 'src/**/*.ts', + '!src/index.ts' ], + mochaOptions: { + files: [ + 'test/helpers/**/*.js', + 'test/unit/**/*.js' + ] + }, testRunner: 'mocha', testFramework: 'mocha', mutator: 'typescript', diff --git a/test/integration/StrykerJestRunnerSpec.ts b/test/integration/StrykerJestRunnerSpec.ts index a217bbf..fc87d69 100644 --- a/test/integration/StrykerJestRunnerSpec.ts +++ b/test/integration/StrykerJestRunnerSpec.ts @@ -39,7 +39,7 @@ describe('Integration StrykerJestRunner', function () { jestConfigEditor = new JestConfigEditor(); runOptions = { - files: [], + fileNames: [], port: 0, strykerOptions: new Config }; diff --git a/test/unit/JestTestRunnerSpec.ts b/test/unit/JestTestRunnerSpec.ts index 6a5767c..bea6172 100644 --- a/test/unit/JestTestRunnerSpec.ts +++ b/test/unit/JestTestRunnerSpec.ts @@ -24,7 +24,7 @@ describe('JestTestRunner', () => { strykerOptions.set({ jest: { config: { property: 'value' }}}); jestTestRunner = new JestTestRunner({ - files: [], + fileNames: [], port: 0, strykerOptions }); From 62e9c3d96c70e2c2e35b59758148af0c9edd8568 Mon Sep 17 00:00:00 2001 From: Nico Jansen Date: Fri, 6 Apr 2018 14:53:36 +0200 Subject: [PATCH 2/3] docs(readme): remove mention of `files` --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index 2c141c8..b5728f5 100644 --- a/README.md +++ b/README.md @@ -56,15 +56,6 @@ The following is an example stryker.conf.js file that will include the tests in ```javascript module.exports = function(config) { config.set({ - files: [ - "src/**/__tests__/*.js", - "src/**/__snapshots__/*.snap", - { - pattern: "src/**/*.js", - mutated: true, - included: false - } - ], testRunner: "jest", mutator: "javascript", coverageAnalysis: "off" From 2e8bfe675780f2dc2186c898b2377db53e38a5bc Mon Sep 17 00:00:00 2001 From: Simon de Lang Date: Fri, 6 Apr 2018 15:08:23 +0200 Subject: [PATCH 3/3] docs(README): remove mention of __tests__ and __snapshots__ --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b5728f5..835ba7f 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,15 @@ The stryker-jest-runner also provides a couple of configurable options using the **Note:** When neither of the options are specified it will use the jest configuration in your "package.json". \ **Note:** the `project` option is ignored when the `config` option is specified. -The following is an example stryker.conf.js file that will include the tests in your `__tests__` directories and snapshots in your `__snapshots__` directories. +The following is an example stryker.conf.js file: ```javascript module.exports = function(config) { config.set({ testRunner: "jest", mutator: "javascript", - coverageAnalysis: "off" + coverageAnalysis: "off", + mutate: ["src/**/*.js"] }); }; ```