-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test-frameworks): Remove side effects from all test-framework pl…
…ugins (#1319) Remove side effects from all test framework plugins. * stryker-jasmine * stryker-mocha-framework
- Loading branch information
Showing
13 changed files
with
2,251 additions
and
7,230 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,39 @@ | ||
{ | ||
"name": "stryker-api", | ||
"version": "0.23.0", | ||
"description": "The api for the extendable JavaScript mutation testing framework Stryker", | ||
"scripts": { | ||
"start": "tsc -w", | ||
"clean": "rimraf \"+(*.d.ts|*.js|*.map)\" \"src/**/+(*.d.ts|*.js|*.map)\" \"test/**/+(*.d.ts|*.js|*.map)\" \"testResources/module/+(*.d.ts|*.js|*.map)\" \"testResources/module/node_modules/stryker-api\" .nyc_output reports", | ||
"test": "nyc --reporter=html --report-dir=reports/coverage --lines 90 --functions 68 --branches 63 npm run mocha", | ||
"mocha": "mocha \"test/unit/**/*.js\" && mocha --timeout 100000 \"test/integration/**/*.js\"" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/stryker-mutator/stryker" | ||
}, | ||
"keywords": [ | ||
"mutation testing", | ||
"mutation", | ||
"testing", | ||
"test", | ||
"js", | ||
"stryker" | ||
], | ||
"contributors": [ | ||
"nicojs <[email protected]>", | ||
"Alex van Assem <[email protected]>", | ||
"Jeremy Nagel <[email protected]>", | ||
"Philipp Weissenbacher <[email protected]>", | ||
"Simon de Lang <[email protected]>" | ||
], | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/stryker-mutator/stryker/issues" | ||
}, | ||
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/stryker-api#readme", | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"dependencies": { | ||
"tslib": "~1.9.3" | ||
}, | ||
"devDependencies": { | ||
"surrial": "~0.1.1", | ||
"typed-inject": "^0.1.1" | ||
} | ||
"name": "stryker-api", | ||
"version": "0.23.0", | ||
"description": "The api for the extendable JavaScript mutation testing framework Stryker", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/stryker-mutator/stryker" | ||
}, | ||
"keywords": [ | ||
"mutation testing", | ||
"mutation", | ||
"testing", | ||
"test", | ||
"js", | ||
"stryker" | ||
], | ||
"contributors": [ | ||
"nicojs <[email protected]>", | ||
"Alex van Assem <[email protected]>", | ||
"Jeremy Nagel <[email protected]>", | ||
"Philipp Weissenbacher <[email protected]>", | ||
"Simon de Lang <[email protected]>" | ||
], | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/stryker-mutator/stryker/issues" | ||
}, | ||
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/stryker-api#readme", | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"dependencies": { | ||
"tslib": "~1.9.3" | ||
}, | ||
"devDependencies": { | ||
"surrial": "~0.1.1", | ||
"typed-inject": "^0.1.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import { TestFrameworkFactory } from 'stryker-api/test_framework'; | ||
import JasmineTestFramework from './JasmineTestFramework'; | ||
import { declareClassPlugin, PluginKind } from 'stryker-api/plugin'; | ||
|
||
TestFrameworkFactory.instance().register('jasmine', JasmineTestFramework); | ||
export const strykerPlugins = [ | ||
declareClassPlugin(PluginKind.TestFramework, 'jasmine', JasmineTestFramework) | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,10 @@ | ||
import * as sinon from 'sinon'; | ||
import * as path from 'path'; | ||
import { TestFrameworkFactory } from 'stryker-api/test_framework'; | ||
import { expect } from 'chai'; | ||
import { strykerPlugins } from '../..'; | ||
import JasmineTestFramework from '../../src/JasmineTestFramework'; | ||
|
||
describe('index', () => { | ||
let sandbox: sinon.SinonSandbox; | ||
|
||
const mockFactory = () => ({ register: sinon.stub() }); | ||
let testFrameworkFactoryMock: any; | ||
|
||
beforeEach(() => { | ||
sandbox = sinon.createSandbox(); | ||
testFrameworkFactoryMock = mockFactory(); | ||
|
||
sandbox.stub(TestFrameworkFactory, 'instance').returns(testFrameworkFactoryMock); | ||
|
||
// Not import the `index` file es6 style, because we need to | ||
// make sure it is re-imported every time. | ||
const indexPath = path.resolve('./src/index.js'); | ||
delete require.cache[indexPath]; | ||
require('../../src/index'); | ||
it('should export strykerPlugins', () => { | ||
expect(strykerPlugins[0].injectableClass).eq(JasmineTestFramework); | ||
}); | ||
|
||
it('should register the JasmineTestFramework', () => | ||
expect(testFrameworkFactoryMock.register).to.have.been.calledWith('jasmine', JasmineTestFramework)); | ||
|
||
afterEach(() => sandbox.restore()); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,53 @@ | ||
{ | ||
"name": "stryker-jest-runner", | ||
"version": "1.3.0", | ||
"description": "A plugin to use the jest test runner and framework in Stryker, the JavaScript mutation testing framework", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"start": "tsc -w", | ||
"clean": "rimraf \"+(test|src)/**/*+(.d.ts|.js|.map)\" .nyc_output reports coverage", | ||
"test": "nyc --reporter=html --report-dir=reports/coverage --lines 80 --functions 80 --branches 75 npm run mocha", | ||
"mocha": "mocha \"test/helpers/**/*.js\" \"test/unit/**/*.js\" && mocha --timeout 30000 \"test/helpers/**/*.js\" \"test/integration/**/*.js\" --exit" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/stryker-mutator/stryker.git" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"keywords": [ | ||
"stryker", | ||
"stryker-plugin", | ||
"jest", | ||
"stryker-test-runner" | ||
], | ||
"author": "Sander koenders <[email protected]>", | ||
"contributors": [ | ||
"Maarten Mulders <[email protected]>", | ||
"mshogren <[email protected]>", | ||
"Nico Jansen <[email protected]>", | ||
"Simon de Lang <[email protected]>", | ||
"Philipp Weissenbacher <[email protected]>", | ||
"Sander koenders <[email protected]>" | ||
], | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/stryker-mutator/stryker/issues" | ||
}, | ||
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/stryker-jest-runner#readme", | ||
"devDependencies": { | ||
"name": "stryker-jest-runner", | ||
"version": "1.3.0", | ||
"description": "A plugin to use the jest test runner and framework in Stryker, the JavaScript mutation testing framework", | ||
"main": "src/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/stryker-mutator/stryker.git" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"keywords": [ | ||
"stryker", | ||
"stryker-plugin", | ||
"jest", | ||
"stryker-test-runner" | ||
], | ||
"author": "Sander koenders <[email protected]>", | ||
"contributors": [ | ||
"Maarten Mulders <[email protected]>", | ||
"mshogren <[email protected]>", | ||
"Nico Jansen <[email protected]>", | ||
"Simon de Lang <[email protected]>", | ||
"Philipp Weissenbacher <[email protected]>", | ||
"Sander koenders <[email protected]>" | ||
], | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/stryker-mutator/stryker/issues" | ||
}, | ||
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/stryker-jest-runner#readme", | ||
"devDependencies": { | ||
"@stryker-mutator/test-helpers": "0.0.0", | ||
"@types/semver": "~5.5.0", | ||
"jest": "~23.6.0", | ||
"react": "~16.7.0", | ||
"react-dom": "~16.7.0", | ||
"react-scripts": "~2.1.0", | ||
"react-scripts-ts": "~3.1.0", | ||
"@types/semver": "~5.5.0", | ||
"jest": "~23.6.0", | ||
"react": "~16.7.0", | ||
"react-dom": "~16.7.0", | ||
"react-scripts": "~2.1.0", | ||
"react-scripts-ts": "~3.1.0", | ||
"stryker-api": "^0.23.0" | ||
}, | ||
"peerDependencies": { | ||
"jest": ">= 22.0.0", | ||
"stryker-api": ">=0.18.0 <0.24.0" | ||
}, | ||
"dependencies": { | ||
"semver": "~5.6.0" | ||
}, | ||
"initStrykerConfig": { | ||
"coverageAnalysis": "off" | ||
} | ||
}, | ||
"peerDependencies": { | ||
"jest": ">= 22.0.0", | ||
"stryker-api": ">=0.18.0 <0.24.0" | ||
}, | ||
"dependencies": { | ||
"semver": "~5.6.0" | ||
}, | ||
"initStrykerConfig": { | ||
"coverageAnalysis": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import { TestFrameworkFactory } from 'stryker-api/test_framework'; | ||
|
||
import MochaTestFramework from './MochaTestFramework'; | ||
import { PluginKind, declareClassPlugin } from 'stryker-api/plugin'; | ||
|
||
TestFrameworkFactory.instance().register('mocha', MochaTestFramework); | ||
export const strykerPlugins = [ | ||
declareClassPlugin(PluginKind.TestFramework, 'mocha', MochaTestFramework) | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,43 @@ | ||
{ | ||
"name": "stryker-mocha-runner", | ||
"version": "0.16.0", | ||
"description": "A plugin to use the mocha test runner in Stryker, the JavaScript mutation testing framework", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"start": "tsc -w", | ||
"clean": "rimraf \"+(test|src)/**/*+(.d.ts|.js|.map)\" .nyc_output reports coverage", | ||
"test": "nyc --reporter=html --report-dir=reports/coverage --lines 80 --functions 80 --branches 75 npm run mocha", | ||
"mocha": "mocha \"test/helpers/**/*.js\" \"test/unit/**/*.js\" && mocha --timeout 10000 \"test/helpers/**/*.js\" \"test/integration/**/*.js\"" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/stryker-mutator/stryker" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"keywords": [ | ||
"stryker", | ||
"stryker-plugin", | ||
"mocha", | ||
"stryker-test-runner" | ||
], | ||
"author": "Simon de Lang <[email protected]>", | ||
"contributors": [ | ||
"Nico Jansen <[email protected]>", | ||
"Simon de Lang <[email protected]>" | ||
], | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/stryker-mutator/stryker/issues" | ||
}, | ||
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/stryker-mocha-runner#readme", | ||
"dependencies": { | ||
"multimatch": "~3.0.0", | ||
"tslib": "~1.9.3" | ||
}, | ||
"devDependencies": { | ||
"name": "stryker-mocha-runner", | ||
"version": "0.16.0", | ||
"description": "A plugin to use the mocha test runner in Stryker, the JavaScript mutation testing framework", | ||
"main": "src/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/stryker-mutator/stryker" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"keywords": [ | ||
"stryker", | ||
"stryker-plugin", | ||
"mocha", | ||
"stryker-test-runner" | ||
], | ||
"author": "Simon de Lang <[email protected]>", | ||
"contributors": [ | ||
"Nico Jansen <[email protected]>", | ||
"Simon de Lang <[email protected]>" | ||
], | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/stryker-mutator/stryker/issues" | ||
}, | ||
"homepage": "https://github.com/stryker-mutator/stryker/tree/master/packages/stryker-mocha-runner#readme", | ||
"dependencies": { | ||
"multimatch": "~3.0.0", | ||
"tslib": "~1.9.3" | ||
}, | ||
"devDependencies": { | ||
"@stryker-mutator/test-helpers": "0.0.0", | ||
"@types/multimatch": "~2.1.2", | ||
"@types/multimatch": "~2.1.2", | ||
"stryker-api": "^0.23.0", | ||
"stryker-mocha-framework": "^0.14.0" | ||
}, | ||
"peerDependencies": { | ||
"mocha": ">= 2.3.3 < 6", | ||
"stryker-api": ">=0.18.0 <0.24.0" | ||
} | ||
}, | ||
"peerDependencies": { | ||
"mocha": ">= 2.3.3 < 6", | ||
"stryker-api": ">=0.18.0 <0.24.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.