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

feat(typescript): Add support for TypeScript mutation testing #376

Merged
merged 63 commits into from
Sep 19, 2017

Conversation

nicojs
Copy link
Member

@nicojs nicojs commented Sep 8, 2017

Add support for JavaScript transpiled languages (ESvNext, TypesScript, Flow, CoffeeScript, etc). Add the stryker-typescript package with mutation testing utilities for TypeScript.

New:

  • Add new plugin type Mutator. With this plugin it is possible to mutate source code. See Mutator.ts to review the API.
  • Add new plugin type Transpiler. With this plugin it is possible to transpile source code to JavaScript. This transpiler is than be used to transpile all source code as well as each mutant. See the explanation in
    Support mutating TypeScript code #344 for more information. See Transpiler.ts for the api details.
  • Add stryker-typescript package. This package contains the plugins used for typescript mutation testing. See readme for more information about that.

BREAKING CHANGE:

  • Hoist the Mutator interface to a higher abstraction. With this interface it was possible to add mutators for specific ES5 AST nodes. As we're moving away from ES5, this plugin abstraction had to be hoisted to a higher level. It is no longer possible to plugin a specific ES5 node mutator.
  • Update report interface: Rename MutantState.Error => MutantState.RuntimeError.

simondel and others added 30 commits July 29, 2017 07:07
* Removed streaming api
* Removed mutant validation from the TypscriptMutantGenerator.
…will be responsible for resetting files to original state
* Override lib locations when resolving files
* Also implement `getDirectories` and `directoriesExist` in the `LanguageServiceHost`
* Normalize paths like typescript does.
* Integration transpiler logic in a seperate process using a generic `ChildProcessProxy` class
* Refactor: Move mutation testing logic from `SandboxCoordinator` to new `MutationTestExecutor` class.
* Refactor: Move initial test run logic from `SandboxCoordinator` to new `InitialTestExecutor` class.
* Remove reliance on `'es6-promise-pool'`
* Add dependency on `rxjs` in order to easily synchronise mutant transpile results with sandboxes
* Rewrite mutation testing logic to make use of the new rxjs way of working
* Rename mutant status `Error` -> `RuntimeError`
* Add mutant status `TranspileError`
* Updated the reporters for new and updated mutation status
return recycleObserver.onNext(sandbox.sandbox);
}

return transpiledMutants
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some comments explaining this return statement?

@simondel simondel changed the title WIP: feat(typescript): Add support for typescript mutation testing feat(typescript): Add support for typescript mutation testing Sep 19, 2017
@simondel simondel changed the title feat(typescript): Add support for typescript mutation testing feat(typescript): Add support for TypeScript mutation testing Sep 19, 2017
@simondel
Copy link
Member

Let's do this!!!

@simondel simondel merged commit ba78168 into master Sep 19, 2017
@simondel
Copy link
Member

Let's keep the branch just to be sure until we release.
New versions:
stryker@0.10.0
stryker-api@0.9.0
stryker-typescript@0.0.1

@simondel simondel deleted the stryker-typescript branch September 22, 2017 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants