Skip to content

Commit

Permalink
feat(es2015-promise): Remove dep to es6-promise
Browse files Browse the repository at this point in the history
  • Loading branch information
simondel authored and nicojs committed Jul 8, 2018
1 parent 54c8877 commit 28453a4
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 40 deletions.
4 changes: 3 additions & 1 deletion packages/stryker-jest-runner/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ module.exports = function (grunt) {
failOnTypeErrors: true
},
build: {
tsconfig: true,
tsconfig: {
passThrough: true
}
},
},

Expand Down
5 changes: 2 additions & 3 deletions packages/stryker-jest-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
},
"homepage": "https://github.com/stryker-mutator/stryker-jest-runner#readme",
"peerDependencies": {
"stryker-api": "^0.3.0-rc2"
"stryker-api": "^0.4.1"
},
"devDependencies": {
"@types/chai-as-promised": "0.0.29",
"@types/es6-promise": "0.0.32",
"@types/estree": "0.0.34",
"@types/lodash": "^4.14.37",
"@types/mocha": "^2.2.32",
Expand All @@ -51,7 +50,7 @@
"mocha": "^3.1.0",
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0",
"stryker-api": "^0.3.0-rc2",
"stryker-api": "^0.4.1",
"tslint": "^3.15.1",
"typescript": "^2.0.3"
}
Expand Down
32 changes: 16 additions & 16 deletions packages/stryker-jest-runner/src/MyTestRunner.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { TestRunner, RunnerOptions, RunOptions, RunResult, TestResult, RunState, TestState } from 'stryker-api/test_runner';
import { TestRunner, RunnerOptions, RunOptions, RunResult, TestResult, RunStatus, TestStatus } from 'stryker-api/test_runner';
import { EventEmitter } from 'events';

/**
* Represents a TestRunner which can execute tests, resulting in a RunResult.
*
* A test runner should:
* - Report per a `testResult` per test. See `TestResult` interfact to know what is expected.
* - Report a `testResult` per test. See `TestResult` interfact to know what is expected.
* - Emit `'test_done'` event with a TestResult as argument every time a test is executed (for reporting purposes)
* - Report on code coverage after the initial test run (maybe, see below)
*
Expand All @@ -24,10 +24,10 @@ import { EventEmitter } from 'events';
* 3. If `coverageStrategy: 'perTest'`: Coverage should be collected per test.
*
* For 2 and 3, Stryker will instrument the code with the istanbul code coverage engine during initial run.
* In case of 3, Stryker will also inject beforeEach and afterEach hooks (specific to each test framework) in distinct between specific tests.
* In case of 3, Stryker will also inject `beforeEach` and `afterEach` hooks (specific to each test framework) in distinct between specific tests.
*
* At the end of the test run, the code coverage report is ready in a global variable called `__coverage__`. Node based test runners
* which run there tests in the same process as the test runner is spawned in actually don't have to do any work, Stryker will be able
* which run their tests in the same process as the test runner is spawned in actually don't have to do any work, Stryker will be able
* to pick up the report globally. However, if running in worker processes or a browser, it is the test runner's responsibility to
* report the `__coverage__` at the end of the test run.
*
Expand Down Expand Up @@ -56,17 +56,17 @@ export default class MyTestRunner extends EventEmitter implements TestRunner {
run(options: RunOptions): Promise<RunResult> {
const oneTestResult: TestResult = {
/**
* The full human readable name of the test
*/
* The full human readable name of the test
*/
name: '',
/**
* The state of the test
* The status of the test
*/
state: TestState.Success,
status: TestStatus.Success,
/**
* Optional: any error messages
*/
// errorMessages: string[];
// failureMessages: string[];

/**
* Optional: the time it took
Expand All @@ -76,20 +76,20 @@ export default class MyTestRunner extends EventEmitter implements TestRunner {

return Promise.resolve({
/**
* The individual test results.
*/
* The individual test results.
*/
tests: [oneTestResult],
/**
* If `state` is `error`, this collection should contain the error messages
* If `status` is `error`, this collection should contain the error messages
*/
errorMessages: ['Error, test runner not implemented'],
/**
* The state of the run
* The status of the run
*/
state: RunState.Complete,
status: RunStatus.Complete,
/**
* Optional: the code coverage result of the run.
*/
* Optional: the code coverage result of the run.
*/
// coverage?: CoverageCollection | CoverageCollectionPerTest;

});
Expand Down
44 changes: 24 additions & 20 deletions packages/stryker-jest-runner/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noImplicitAny": true,
"moduleResolution": "node",
"rootDir": ".",
"sourceMap": true,
"removeComments": false,
"declaration": true,
"forceConsistentCasingInFileNames": true,
"allowJs": false,
"noUnusedLocals": true,
"noImplicitReturns": true,
"strictNullChecks": true
},
"exclude": [
"node_modules",
"testResources",
"**/*.d.ts",
"*.d.ts"
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noImplicitAny": true,
"moduleResolution": "node",
"rootDir": ".",
"sourceMap": true,
"removeComments": false,
"declaration": true,
"forceConsistentCasingInFileNames": true,
"allowJs": false,
"noUnusedLocals": true,
"noImplicitReturns": true,
"strictNullChecks": true,
"lib": [
"es5",
"es2015.promise"
]
},
"exclude": [
"node_modules",
"testResources",
"**/*.d.ts",
"*.d.ts"
]
}

0 comments on commit 28453a4

Please sign in to comment.