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

Implement mutation switching #2340

Merged
merged 202 commits into from
Oct 7, 2020
Merged

Implement mutation switching #2340

merged 202 commits into from
Oct 7, 2020

Commits on May 15, 2020

  1. chore: disable e2e tests for mutation switching

    Temporarily disable e2e tests while we work in the mutation switching epic.
    nicojs committed May 15, 2020
    Configuration menu
    Copy the full SHA
    a7cad83 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3d5ae2b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    197e177 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2020

  1. Configuration menu
    Copy the full SHA
    9e99c4a View commit details
    Browse the repository at this point in the history

Commits on May 19, 2020

  1. build(deps-dev): bump @typescript-eslint/eslint-plugin (#2219)

    Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.33.0 to 2.34.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.34.0/packages/eslint-plugin)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed May 19, 2020
    Configuration menu
    Copy the full SHA
    4f2f620 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ba43da3 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2020

  1. feat(instrumenter): add parsers (#2222)

    Add parsers to the instrumenter package. 
    
    Add support for:
    
    * Parsing `*.js`, `*.tsx`, `*.html` and `*.vue` files.
    * Load custom babel config with `babel.config` format and `.babelrc` format.
    nicojs committed May 25, 2020
    Configuration menu
    Copy the full SHA
    3b57ef2 View commit details
    Browse the repository at this point in the history
  2. feat(instrumenter): add printers #2223

    Add printers for html, ts, vue and js files.
    nicojs committed May 25, 2020
    Configuration menu
    Copy the full SHA
    78a021c View commit details
    Browse the repository at this point in the history

Commits on May 28, 2020

  1. feat(instrumenter): add mutant placers (#2224)

    Add mutant placers.
    
    * `switchCaseMutantPlacer`: places a mutant in a switch case
    * `conditionalExpressionMutantPacer`: places a mutant in a conditional expression
    nicojs committed May 28, 2020
    Configuration menu
    Copy the full SHA
    0e05025 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2020

  1. build(deps): bump @babel/traverse from 7.9.6 to 7.10.1 (#2233)

    Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.9.6 to 7.10.1.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.10.1/packages/babel-traverse)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed May 30, 2020
    Configuration menu
    Copy the full SHA
    e66aed4 View commit details
    Browse the repository at this point in the history
  2. build(deps-dev): bump @typescript-eslint/parser from 2.33.0 to 2.34.0 (

    …#2218)
    
    Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.33.0 to 2.34.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.34.0/packages/parser)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed May 30, 2020
    Configuration menu
    Copy the full SHA
    a2f8bb8 View commit details
    Browse the repository at this point in the history
  3. build(deps): bump @babel/core from 7.9.6 to 7.10.1 (#2227)

    Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.9.6 to 7.10.1.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.10.1/packages/babel-core)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed May 30, 2020
    Configuration menu
    Copy the full SHA
    edd5510 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    912d4e2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d6a5eb3 View commit details
    Browse the repository at this point in the history
  6. feat(instrumenter): add transformers (#2234)

    Add transformers. Transformers are responsible for the process of generating mutants and placing them in the AST. 
    
    * `htmlTransformer`: Capable of transforming html AST
    * `babelTransformer`: Capable of transforming babel AST (JS and TS)
    nicojs committed May 30, 2020
    Configuration menu
    Copy the full SHA
    61c8fe6 View commit details
    Browse the repository at this point in the history
  7. build(deps-dev): bump flatted from 2.0.2 to 3.0.2 (#2231)

    Bumps [flatted](https://github.com/WebReflection/flatted) from 2.0.2 to 3.0.2.
    - [Release notes](https://github.com/WebReflection/flatted/releases)
    - [Commits](WebReflection/flatted@v2.0.2...v3.0.2)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed May 30, 2020
    Configuration menu
    Copy the full SHA
    88e40aa View commit details
    Browse the repository at this point in the history
  8. build(deps): bump @babel/parser from 7.9.6 to 7.10.2 (#2235)

    Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.9.6 to 7.10.2.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.10.2/packages/babel-parser)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed May 30, 2020
    Configuration menu
    Copy the full SHA
    0fb8f59 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2020

  1. Configuration menu
    Copy the full SHA
    d7f37e6 View commit details
    Browse the repository at this point in the history
  2. feat(instrumenter): implement Instrumenter class

    Implement `Instrumenter` class, responsible for:
    * Parsing code to an AST
    * Mutant generation based on AST
    * Transforming the code to incorporate the mutants in mutation switches
    * Printing AST back to code
    nicojs committed Jun 1, 2020
    Configuration menu
    Copy the full SHA
    8df9172 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2020

  1. Configuration menu
    Copy the full SHA
    7e9fdb6 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2020

  1. feat(checker): add checker api (#2240)

    Adds `Checker` plugin type, to be used in #1514 (and can later be used to filter mutants in #1980).
    
    The idea is that, before mutation testing (or even before files are instrumented), we initialize the checker. It can be used as a sanity check. The `TypescriptChecker` can use this to load all files and compile once (with `--no-emit`) to make sure errors don't occur under normal circumstances. 
    
    The `check` method is called one-by-one on each mutant. A checker can decide to assign any of a `CheckStatus`. If it `Passed` it proceeds to the next checker, or if it was the last checker it will be run in a test runner. If another status is assigned, it will stop processing that mutant and report it as done.
    nicojs committed Jun 9, 2020
    Configuration menu
    Copy the full SHA
    d463f86 View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2020

  1. fix(jasmine-runner): update deprecated api calls (#2250)

    Removes some calls to deprecated Jasmine APIs.
    
    | Old | New |
    |--|--|
    | `throwOnExpectationFailure` | `jasmine.Env.configure( { oneFailurePerSpec: true } )` |
    | `stopOnSpecFailure` | `jasmine.Env.configure( { failFast: true } )`  | 
    | `jasmine.addReporter` | `jasmine.env.addReporter` |
    | `jasmine.clearReporters` | `jasmine.env.clearReporters` |
    nicojs committed Jun 10, 2020
    Configuration menu
    Copy the full SHA
    b6d6dfd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d330af9 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2020

  1. feat(api): add id to Mutant interface (#2255)

    Add `id` property to `Mutant` api
    nicojs committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    cfc9053 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2020

  1. chore(instrumentator): improve instrument syntax

    Update instrumenter syntax with latest design of test runner api.
    
    * `__mutationCoverage__` -> `__mutantCoverage__`
    * `activeMutant` --> `__activeMutant__`
    nicojs committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    d47e8e7 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2020

  1. Configuration menu
    Copy the full SHA
    976417f View commit details
    Browse the repository at this point in the history
  2. feat(api): add new test runner api (#2249)

    Adds a new test runner API to Stryker. Differences with the old API:
    
    1. Explicit difference between a `dryRun` (initial test run) and a `mutantRun`
       1. A mutantRun result has an `activeMutant` field indicating which mutant should be activated by the runner
       2.  The result types are also explicit. A `MutantRunResult` now reports back the status as `Killed` or `Survived` instead of letting Stryker make that decision. 
    2. Code coverage interfaces are replaced with the simpler `MutantCoverage` interface.
    3. The `MutantRunOptions` now has a `testFilter`, which replaces the old `TestFramework` API.
    
    Add small improvements
    
    * Add an `id` field to a `TestResult` and using that id for the filtering instead of the cumbersome `TestSelection` interface we introduced to handle string identifiers (names)
    * `TestResult`, `DryRunResult` and `MutantRunResult` to be implemented using [discrimitated unions](https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions). This removes a lot of the optional fields. For example, `errorMessage` is now a required field on an `ErrorDryRunResult`.
    * Defined `errorMessage` and `failureMessage` to be a `string`, instead of a `string[]`. If runners want to report more messages, they will have to concatenate themselves.
    * A `MutantRunResult` no longer has to report back all tests that have run. Instead, it only reports the id of the test that killed the mutant (if the status is indeed `killed`).
    * A `MutantRunResult` no longer has to report back all tests that have run. Instead, it only reports the id of the test that killed the mutant (if the status is indeed `killed`).
    * Added a `toMutantRunResult` helper function that takes in a `dryRunResult` and can convert it to a `mutantRunResult`.
    
    The new API is published under `TestRunner2`, as well as a separate plugin type. Later we will remove the old test runner API and rename this new one to `TestRunner` proper.
    nicojs committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    bbbc308 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c4ea34a View commit details
    Browse the repository at this point in the history
  4. build(deps-dev): bump karma from 5.0.9 to 5.1.0

    Bumps [karma](https://github.com/karma-runner/karma) from 5.0.9 to 5.1.0.
    - [Release notes](https://github.com/karma-runner/karma/releases)
    - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
    - [Commits](karma-runner/karma@v5.0.9...v5.1.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    75e8c75 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e56487c View commit details
    Browse the repository at this point in the history
  6. build(deps): bump inquirer from 7.1.0 to 7.2.0 (#2263)

    Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) from 7.1.0 to 7.2.0.
    - [Release notes](https://github.com/SBoudrias/Inquirer.js/releases)
    - [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@7.1.0...inquirer@7.2.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    22af886 View commit details
    Browse the repository at this point in the history
  7. build(deps): bump chalk from 4.0.0 to 4.1.0 (#2252)

    Bumps [chalk](https://github.com/chalk/chalk) from 4.0.0 to 4.1.0.
    - [Release notes](https://github.com/chalk/chalk/releases)
    - [Commits](chalk/chalk@v4.0.0...v4.1.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    e75640b View commit details
    Browse the repository at this point in the history
  8. build(deps): bump enhanced-resolve from 4.1.1 to 4.2.0 (#2264)

    Bumps [enhanced-resolve](https://github.com/webpack/enhanced-resolve) from 4.1.1 to 4.2.0.
    - [Release notes](https://github.com/webpack/enhanced-resolve/releases)
    - [Commits](webpack/enhanced-resolve@v4.1.1...v4.2.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    e2a325a View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2020

  1. feat(jasmine-runner): implement new test runner api (#2256)

    Implement new test runner api in the jasmine-runner.
    
    See #2249
    nicojs committed Jun 17, 2020
    Configuration menu
    Copy the full SHA
    871db8c View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2020

  1. feat(typescript-checker): a typescript type checker plugin (#2241)

    Introducing the typescript type-checker plugin. 
    
    ## Features
    
    👽 Type check each mutant. Invalid mutants will be marked as `CompileError` in your Stryker report.  
    🧒 Easy to setup, only your `tsconfig.json` file is needed.  
    🔢 Type check is done in-memory, no side effects on disk.  
    🎁 Support for both single typescript projects as well as projects with project references (`--build` mode).  
    
    ## Configuring
    
    You can configure the typescript checker in the `stryker.conf.js` (or `stryker.conf.json`) file.
    
    ```js
    // stryker.conf.json
    {
      "checkers": ["typescript"],
      "typescriptChecker": {
        "tsconfigFile": "tsconfig.json"
      }
    }
    ```
    
    ### `typescriptChecker.tsconfigFile` [`string`]
    
    Default: `'tsconfig.json'`
    
    The path to your [tsconfig](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). Project references _are supported_, `--build` mode will be enabled automatically when references are found in your tsconfig.json file.
    
    ## Implemenation
    
    The `@stryker-mutator/typescript-checker` is not using the [typescript language service api](https://github.com/Microsoft/TypeScript/wiki/Using-the-Language-Service-API), like the current [typescript transpiler](https://github.com/stryker-mutator/stryker/blob/f44008993a543dc3f38ca99516f56d315fdcb735/packages/typescript/src/transpiler/TranspilingLanguageService.ts#L23) is. Instead, it's using the [compiler API](https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API). The language service API wasn't really designed for our use case. For example, it doesn't support project references, nor will it ever (read this somewhere, unfortunately, cannot find the source). It also took a lot of code to get working, with a pretty high number of bugs 🐛. Even in our own project, we needed separate `tsconfig.stryker.json` config files. Very annoying.
    
    The compiler API is somewhat more low-level. We're starting the compiler on `initialize()` method of the checker API. If the initial build fails, we're rejecting the promise. Each mutant is checked basically the same way as it was in the old typescript transpiler. Namely, the previous mutant is removed, the new mutant is placed and the typescript compiler runs. If it errors, the `CheckStatus.CompilError` status is reported with the error text in the `reason` field.
    
    There are some nifty tricks to be found:
    
    1. During `initialize()` the typescript compiler starts. We're reading all files from disk synchronously and storing them in memory. After the initial build, all files should be in-memory, no further files are pulled in.
        * We're using the `ts.createSolutionBuilderWithWatch`. This creates a compiler with `--build` mode enabled. This seems to work for both single-project solutions as for a multi project solution with project references. This api is available since ts `3.6`, so we're throwing an error if a previous version of typescript is found.
    1. The way to inform the typescript compiler that a file has changed is to "pretend" as if the file changed on disk. The file system watcher is informed in-memory of the change. This triggers a rebuild.
    1. In order to still override compiler options as specified in #391, we're transforming each tsconfig.json file as it is read from disk. This way we can force the compiler options we want. The config file can also be named differently, each tsconfig file is scanned for `references` in order to make sure we're only transforming the tsconfig files that are used.
    1. In order to ensure the best performance, `--noEmit` is forced. This will prevent the typescript compiler from outputting code. Unfortunately  `--noEmit` is forbidden for `--build` mode, which is why `--emitDeclarationsOnly` is forced for those projects.
    nicojs committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    42adb95 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2020

  1. Configuration menu
    Copy the full SHA
    482c782 View commit details
    Browse the repository at this point in the history
  2. feat(mutators): add mutators to instrumenter package (#2266)

    Add our existing mutators:
    
    * ArithmeticOperator
    * ArrayDeclaration
    * ArrowFunction
    * BlockStatement
    * BooleanLiteral
    * ConditionalExpression
    * EqualityOperator
    * LogicalOperator
    * ObjectLiteral
    * StringLiteral
    * UnaryOperator
    * UpdateOperator
    simondel committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    3b87743 View commit details
    Browse the repository at this point in the history
  3. feat(karma-runner): implement v2 test runner api (#2267)

    * Implement new v2 test runner API (see #2249 )
    * Make sure to not report coverage when it isn't needed
    * Add a framework adapter file that adds mutant coverage to the karma result, to be picked up by the stryker reporter
    * Add test filtering capability when running with jasmine or mocha
    * Add integration tests on instrumented code.
    * Some more housekeeping.
    nicojs committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    04dd5f7 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2020

  1. Configuration menu
    Copy the full SHA
    5e0cbe7 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2020

  1. Configuration menu
    Copy the full SHA
    0b602b6 View commit details
    Browse the repository at this point in the history
  2. build(deps-dev): bump eslint from 7.3.0 to 7.3.1

    Bumps [eslint](https://github.com/eslint/eslint) from 7.3.0 to 7.3.1.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.3.0...v7.3.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    d6f2bda View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2020

  1. Configuration menu
    Copy the full SHA
    6cc3ab9 View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2020

  1. Configuration menu
    Copy the full SHA
    b68b3a0 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2020

  1. build(deps): bump rxjs from 6.5.5 to 6.6.0 (#2282)

    Bumps [rxjs](https://github.com/reactivex/rxjs) from 6.5.5 to 6.6.0.
    - [Release notes](https://github.com/reactivex/rxjs/releases)
    - [Changelog](https://github.com/ReactiveX/rxjs/blob/6.6.0/CHANGELOG.md)
    - [Commits](ReactiveX/rxjs@6.5.5...6.6.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed Jul 3, 2020
    Configuration menu
    Copy the full SHA
    72f24db View commit details
    Browse the repository at this point in the history
  2. feat(core): simple mutation switching process (#2269)

    Implement a simple mutation testing process using mutation switching. It represents a new way of running mutation testing, where we place all mutants in the code at the same time. This is only the first step and lacks support for more advanced use cases.
    
    This is a non-exhaustive list of changes:
    * Add `Location` to the `Mutant` API, for ease of reporting
    * Implement `TestRunner2` factory
    * Revamped the way the main Stryker class works. All of the internals are moved to separate `Executor` classes. An `Executor` is responsible for _managing_ a part of the process. I think this helps enormously to understand the general process of mutation testing.
      * `PrepareExecutor`: Responsible to read configuration and input files from disk.
      * `MutantInstrumenterExecutor`: Responsible for instrumenting the source code and generating mutants
      * `DryRunExecutor`: Responsible for performing the initial test run.
      * `MutationTestExecutor`: Responsible for running actual mutation testing.
    * Revamped the `Sandbox` class. It is now only responsible for filling a sandbox with files. It no longer manages mutants inside the sandbox or the test runner instance. 
    * Revamped the `SandboxPool` -> `TestRunnerPool`, which now manages only test runner instances.
       * An improvement I've managed to sneak in, is that the test runner process from the dry run is now reused in the mutation test run. Not a huge deal, but a nice bonus.
    * Removed a bunch of dead code related to the `TestFramework` and `Mutator` plugins, see breaking changes
    * Re-enabled 2 simple e2e tests 🎉 
    
    BREAKING CHANGES:
    
    Most of these changes are related to internals of Stryker plugins.
    
    * Transpilers plugins are no longer supported. Transpiler-like functionality will be possible with a build command and checker API. More on those in future PR's
    * Custom mutators are no longer supported, Stryker now brings its own mutator in the form of `@stryker-mutator/instrumenter`. It uses babel and an HTML parser under the hood so it has support for all the usual suspects.
    * Test Framework plugins are no longer supported. Test runners are supposed to bring their own support for test frameworks they might want to support. This has no consequences for the list of officially supported test runners.
    * Test runner v1 API is no longer supported. Please move to the new Test Runner API.
    nicojs committed Jul 3, 2020
    Configuration menu
    Copy the full SHA
    9d4671b View commit details
    Browse the repository at this point in the history
  3. feat(core): add support for checker plugins (#2285)

    Add support for Checker plugins. A checker plugin takes the place of the old transpiler plugin. When a checker plugin is configured, every mutant is checked before a test runner picks it up. This will allow typescript type checking to take place using the `@stryker-mutator/typescript-checker` plugin.
    
    Since checking a mutant can take a long time (~2 sec/mutant with the `@stryker-mutator/typescript-checker` on Stryker's core project), we use worker processes to run this in parallel. These processes are entirely managed by Stryker core, plugin creators don't need to worry about this.
    
    Add `--concurrency` (or `-c`) option which set the number of concurrent worker processes to be used by Stryker. A worker can be a checker process or a test runner process. The default is nr of CPU's available -1, with a minimum of 1 test runner process and 1 checker process (if a checker is configured).
    
    The algorithm used to determine the number of checkers is `ceil(--concurrency / 2)`. This allows room for `floor(--concurrency / 2)` test runners. Once the check process is done, all check processes are closed and more test runner processes are spun up to speed up the mutation testing process.
    
    BREAKING CHANGE:
    
    * `--maxConcurrentTestRunners` is now deprecated. Please use `--concurrency` instead.
    nicojs committed Jul 3, 2020
    Configuration menu
    Copy the full SHA
    69358e1 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2020

  1. Configuration menu
    Copy the full SHA
    39bb838 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2c61e97 View commit details
    Browse the repository at this point in the history
  3. fix(instrumenter): don't mutate require

    Don't mutate string literals in require call expressions. Webpack and other bundlers don't like it.
    nicojs committed Jul 4, 2020
    Configuration menu
    Copy the full SHA
    963e289 View commit details
    Browse the repository at this point in the history
  4. feat(core): support build command

    Add support for `buildCommand` configuration option. This allows users to configure a command which is run inside the sandbox just before actual mutation testing starts, but after the files are mutated.
    
    This can be used to run transpilation or bundling for setups where the test runner doesn't already take care of that.
    
    For example:
    
    ```json
    {
      "buildCommand": "npm run build"
    }
    ```
    
    Chore:
    * Add dependency on `execa` and `npm-run-path` to help with the running of a command
    * Enable 2 more e2e tests: `vue-javascript` nad `webpack-zero-conf-karma`
    nicojs committed Jul 4, 2020
    Configuration menu
    Copy the full SHA
    f71ba87 View commit details
    Browse the repository at this point in the history
  5. fix(karma-runner): mocha filtering with / (#2290)

    When a test name contains a `/`, correctly escape it. Stryker blows up in your face without it.
    nicojs committed Jul 4, 2020
    Configuration menu
    Copy the full SHA
    3918633 View commit details
    Browse the repository at this point in the history
  6. feat(sandbox): add ignore header to js files (#2291)

    Add an ignore header to each js (or friend) file in the sandbox. This should allow files to be transpiled no matter the contents. For more info, see #2276
    
    The header now consists of:
    
    ```js
    /* eslint-disable */
    // @ts-nocheck
    ```
    
    But we can later decide to include more ignore rules.
    nicojs committed Jul 4, 2020
    Configuration menu
    Copy the full SHA
    3adde83 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2020

  1. feat(tsconfig): rewrite tsconfig references (#2292)

    Add a new `tsconfigFile` option (reused from the old `@stryker-mutator/typescript` package). Use this new option in the `@stryker-mutator/typescript-checker` instead of a specific typescript-checker specific one
    
    From stryker core, use this setting to rewrite `tsconfig.json` file's `references` and `extends` when they refer config files that fall outside of the sandbox.
    
    For example:
    
    ```json
    {
      "extends": "../../tsconfig.settings.json",
      "references": {
         "path": "../model"
      }
    }
    ```
    
    becomes:
    ```json
    {
      "extends": "../../../../tsconfig.settings.json",
      "references": {
         "path": "../../../model"
      }
    }
    ```
    
    
    
    The implementation relies on typescript being available, but will only import it when it found a tsconfig.json file. Once a tsconfig file is found, referenced files within the sandbox also get rewritten.
    
    Closes #2276
    nicojs committed Jul 5, 2020
    Configuration menu
    Copy the full SHA
    4ee4950 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2020

  1. build(deps-dev): bump eslint from 7.3.1 to 7.4.0

    Bumps [eslint](https://github.com/eslint/eslint) from 7.3.1 to 7.4.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.3.1...v7.4.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    8e2f176 View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2020

  1. Configuration menu
    Copy the full SHA
    22585bc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    99c274e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    90e379e View commit details
    Browse the repository at this point in the history
  4. refactor(mocha-runner): introduce MochaAdapter (#2300)

    Introduce the mocha adapter. It contains all mocha polyfills.
    nicojs committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    dfae39a View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2020

  1. feat(mocha-runner): implement new test runner api (#2303)

    Implement new test runner api in the mocha.
    nicojs committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    574e86f View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2020

  1. fix(sandbox): exec build command before symlink

    Execute the `buildCommand` before the node_modules are symlinked inside the sandbox. This way, there is more chance that the node_modules can be resolved correctly.
    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    bd25cd6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    77b6a20 View commit details
    Browse the repository at this point in the history
  3. feat(html-parser): add // @ts-nocheck to scripts

    Force `@ts-nocheck` mode for instrumented script tags. This way the vue cli will allow compilation of ts code with type errors due to mutation switching
    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    8ceff31 View commit details
    Browse the repository at this point in the history
  4. feat(instrumenter): allow override of babel plugins

    Allow an override of babel plugins for js files. This uses the 'old' `mutator.pl
    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    8758cfd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9267b6f View commit details
    Browse the repository at this point in the history
  6. feat(test-framework): remove TestFramework API

    Remove the test framework API and their implementations: `@stryker-mutator/jasmine-framework` and `@stryker-mutator/mocha-framework`. Test runners are now expected to cary their own support for different test frameworks they might support.
    
    A `TestFramework` provided decoupling between the framework and the test runner itself. It was used to provide test filtering and `perTest` coverage analysis. Historically, this decoupling only came in use for `karma`, since that is the only test runner that supports multiple test frameworks. Support for filtering `mocha` and `jasmine` tests is now build into the `@stryker-mutator/karma-runner` itself, as well as the other supported test runners.
    
    Therefore this API is no longer used, which makes it easier to configure Stryker and easier to maintain.
    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    fe5e200 View commit details
    Browse the repository at this point in the history
  7. feat(transpiler): remove Transpiler API

    Remove the `Transpiler` API and all it's implementations: `@stryker-mutator/babel-transpiler`, `@stryker-mutator/typescript` and `@stryker-mutator/webpack-transpiler`. Please use the `buildCommand` option instead.
    
    Before Stryker [implemented Mutation Switching](#1514), each mutant was placed in the code one by one. In case a test runner didn't support transpiling, it needed to be transpiled by Stryker. In order to improve performance, this was done by keeping the transpiler process alive. This way the transpiler/bundler's internal `--watch` functionality could be used to speed up the process.
    
    This is no longer needed in a Mutation Switching world. All mutants are placed in the code at the same time. The performance gain isn't there anymore. This opens up the way for a generic `buildCommand` to be configured and used. This way every transpiler/bundler is supported (i.e. rollup, parcel, browserify, closure compiler, my-custom-transpiler.js, etc).
    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    06f668b View commit details
    Browse the repository at this point in the history
  8. feat(mutator): remove Mutator API

    Remove the `Mutator` API and it's implementations: `@stryker-muator/javascript-mutator`, `@stryker-muator/typescript` and `@stryker-muator/vue-mutator`. Stryker now uses it's own `@stryker-mutator/instrumenter`, which can mutate all JavaScript and friend languages, i.e. JS, TS, Flow, JSX as well as script tags in .vue and .html files`. It uses the awesome babel parser underneath.
    
    When we started out with Stryker, there was no 1-size-fits-all parser out there. Thus, to [introduce support for TypeScript in 2017](https://stryker-mutator.io/blog/2017-10-06/typescript-support), we introduced the mutator plugin api. This way, uses could choose to use TypeScript or JavaScript, both plugins with their own parser. Fast forward to 2020 and beyond and this becomes limitting for users as well as maintainers. We wanted to support hibrid projects and more features that integrate with the parser itself. Most notibly, [mutation switching](#1514).
    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    3ca89cf View commit details
    Browse the repository at this point in the history
  9. feat(api): remove support for options editors

    Remove support for `OptionEditor` plugin types. Plugins are now expected to read their own config, from whatever source they want, in their own respective lifecycle.
    
    `OptionsEditor`s (and `ConfigEditor`s before that) provided a way to edit stryker configuration after it was read from disk, but before mutation testing starts. This sounded good at first, but the very nature if OptionsEditors meant that users cannot disable them. They are also limited, because the configuration that is read from disk also needs to be serializable if you want it to end up in your x.y.z. plugin. It was also not great for maintainability.
    
    Stryker's core plugins (`@stryker-mutator/...`) quitely moved away from using the `OptionEditor` API and we are now finally ready to pull the plugin on it once and for all.
    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    5e56d0e View commit details
    Browse the repository at this point in the history
  10. test(e2e): update local dependencies

    Remove deleted plugins from local dependencies.
    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    13c780d View commit details
    Browse the repository at this point in the history
  11. fix(typescript-checker): support empty files (#2310)

    Fix for `inner error: TypeError: Cannot read property 'modifiedTime' of undefined` error.
    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    284a28c View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    8bd634b View commit details
    Browse the repository at this point in the history
  13. fix(reporter): report event order (#2311)

    Report `onAllMutantsTested` before `onMutationTestReportReady`
    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    ceb73a8 View commit details
    Browse the repository at this point in the history
  14. v4.0.0-beta.0

    nicojs committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    6c7b6db View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2020

  1. Configuration menu
    Copy the full SHA
    8f956f0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7b53ca9 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2020

  1. Configuration menu
    Copy the full SHA
    0bbc0c1 View commit details
    Browse the repository at this point in the history
  2. v4.0.0-beta.1

    simondel committed Jul 17, 2020
    Configuration menu
    Copy the full SHA
    2973eef View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2020

  1. build(deps-dev): bump eslint from 7.4.0 to 7.5.0

    Bumps [eslint](https://github.com/eslint/eslint) from 7.4.0 to 7.5.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.4.0...v7.5.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    80c8966 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2020

  1. Configuration menu
    Copy the full SHA
    c759ef1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c4c9be0 View commit details
    Browse the repository at this point in the history
  3. build(deps-dev): bump @types/mocha from 7.0.2 to 8.0.0 (#2317)

    Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 7.0.2 to 8.0.0.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed Jul 21, 2020
    Configuration menu
    Copy the full SHA
    adf87b7 View commit details
    Browse the repository at this point in the history
  4. build(deps): bump inquirer from 7.2.0 to 7.3.2 (#2318)

    Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) from 7.2.0 to 7.3.2.
    - [Release notes](https://github.com/SBoudrias/Inquirer.js/releases)
    - [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@7.2.0...inquirer@7.3.2)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed Jul 21, 2020
    Configuration menu
    Copy the full SHA
    0507993 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2020

  1. build(deps-dev): bump jasmine-core from 3.5.0 to 3.6.0

    Bumps [jasmine-core](https://github.com/jasmine/jasmine) from 3.5.0 to 3.6.0.
    - [Release notes](https://github.com/jasmine/jasmine/releases)
    - [Changelog](https://github.com/jasmine/jasmine/blob/main/RELEASE.md)
    - [Commits](jasmine/jasmine@v3.5.0...v3.6.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    76785f4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    625f7d9 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2020

  1. Configuration menu
    Copy the full SHA
    4319e90 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    22cd4a4 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2020

  1. fix(mutator): issue with block statement mutator (#2342)

    Don't mutate constructor bodies with a super call in combination with parameter properties.
    
    Fixes #2314
    nicojs committed Aug 1, 2020
    Configuration menu
    Copy the full SHA
    aaa4ff6 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2020

  1. build(deps-dev): bump eslint from 7.5.0 to 7.6.0

    Bumps [eslint](https://github.com/eslint/eslint) from 7.5.0 to 7.6.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.5.0...v7.6.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    0e8f2e4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1aad9d6 View commit details
    Browse the repository at this point in the history
  3. refactor(cleanup): provide more accurate types and fix small issues (#…

    …2326)
    
    * Provide better types for functions
    * fix promise catch resolve
    * update versions of of core packages
    * use `concurrency` instead of `maxConcurrentTestRunners` for Stryker's own configuration and e2e tests.
    Bartosz Leoniak committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    4975259 View commit details
    Browse the repository at this point in the history
  4. build(deps): bump commander from 5.1.0 to 6.0.0 (#2325)

    Bumps [commander](https://github.com/tj/commander.js) from 5.1.0 to 6.0.0.
    - [Release notes](https://github.com/tj/commander.js/releases)
    - [Changelog](https://github.com/tj/commander.js/blob/master/CHANGELOG.md)
    - [Commits](tj/commander.js@v5.1.0...v6.0.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    0010741 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    310145e View commit details
    Browse the repository at this point in the history
  6. build(deps): bump log4js from 6.2.1 to 6.3.0 (#2221)

    * build(deps): bump log4js from 6.2.1 to 6.3.0
    
    Bumps [log4js](https://github.com/log4js-node/log4js-node) from 6.2.1 to 6.3.0.
    - [Release notes](https://github.com/log4js-node/log4js-node/releases)
    - [Changelog](https://github.com/log4js-node/log4js-node/blob/master/CHANGELOG.md)
    - [Commits](log4js-node/log4js-node@v6.2.1...v6.3.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    * Fix type error in core unit tests
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    Co-authored-by: Nico Jansen <jansennico@gmail.com>
    dependabot-preview[bot] and nicojs committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    05d288f View commit details
    Browse the repository at this point in the history
  7. build(deps): Revert bump log4js, back to 6.2.1 (#2221)

    Child process loggers aren't behaving well, resulting in unexpected
    crashes
    nicojs committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    a98e701 View commit details
    Browse the repository at this point in the history
  8. feat(command): Support command test runner with mutation switching (#…

    …2345)
    
    Add support for the command test runner with mutation switching.
    
    _NOTE: Support for the command test runner is best effort!_. It might not work for your test runner of choice.
    
    Switching of mutants is done by providing the __STRYKER_ACTIVE_MUTANT__ environment variable when executing the command. The `@stryker-mutator/instrumenter` now adds a check for this environment variable in each source file. This only works if the command you configure allows for this environment variable to flow through to the test environment.
    
    In other words: this should work for node test runners like [node-tap](https://node-tap.org/) and mocha but not for test runners that spin up their own test environment, like jest or karma.
    
    Note that for mocha, karma and jest, you're better of using their respective test runner plugins.
    nicojs committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    59b1cfc View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2020

  1. Configuration menu
    Copy the full SHA
    1296d83 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d8b368d View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2020

  1. feat(jest-runner): support mutation switching (#2350)

    Add mutation switching support (new test runner API) for `@stryker-mutator/jest-runner`.
    
    * Implement new test runner interface in `@stryker-mutator/jest-runner`.
    * Add `sandboxFileName` to `RunOptions` and use that in the jest runner to provide the "fileNameUnderTest"
    * Enable 3 jest e2e tests
    * Add support for `.tsx` files to `@stryker-mutator/instrumenter`
    nicojs committed Aug 5, 2020
    Configuration menu
    Copy the full SHA
    9e6e6e0 View commit details
    Browse the repository at this point in the history
  2. fix(instrumenter): don't mutate string literals in object properties (#…

    …2354)
    
    Don't mutate string literals in object property keys. An example:
    
    ```js
    // don't mutate these!
    const { "aria-label": label } = props;
    const foo = { ["aria-label"]: label };
    
    // However, still mutate strings in property values
    const bar = { baz: 'qux' } // mutated to { baz: '' }
    ```
    nicojs committed Aug 5, 2020
    Configuration menu
    Copy the full SHA
    cd43952 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4d32142 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2020

  1. chore(typescript-checker): improve logging (#2359)

    Log whenever a file is being watched.
    nicojs committed Aug 7, 2020
    Configuration menu
    Copy the full SHA
    8016080 View commit details
    Browse the repository at this point in the history
  2. v4.0.0-beta.2

    nicojs committed Aug 7, 2020
    Configuration menu
    Copy the full SHA
    7095548 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e493f4a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    68496cd View commit details
    Browse the repository at this point in the history
  5. feat(jest-runner): remove deprecated project types (#2361)

    Remove deprecated project types.
    * `react` --> `create-react-app`
    * `react-ts` --> `create-react-app-ts`
    
    BREAKING CHANGE: Project types `react` and `react-ts` has been removed. Please use `create-react-app` and `create-react-app-ts` respectively
    nicojs committed Aug 7, 2020
    Configuration menu
    Copy the full SHA
    d0aa5c3 View commit details
    Browse the repository at this point in the history
  6. feat(core): add ability to override file headers (#2363)

    Add the ability to override the file headers inside a sandbox. This allows users to opt-out of the default header, as well as add custom headers.
    
    You can configure it like this:
    
    ```json
    {
      "sandboxFileHeaders": {
      "**/*.ts": "// Hello world\n"
      }
    }
    ```
    
    The key here is a [glob expression](https://globster.xyz/), where the value points to the header to be used for matching files.
    nicojs committed Aug 7, 2020
    Configuration menu
    Copy the full SHA
    430d6d3 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2020

  1. feat(core): strip comments in sandbox (#2365)

    Strip comments of JavaScript and friend files in the sandbox. This will make sure no `// @ts-expect-error` or `// @ts-check` comments survive, as they break typescript compilation. You can configure this behavior.
    
    ```js
    {
      "sandbox": {
        "stripComments": "**/*+(.js|.ts|.cjs|.mjs)?(x)"
      }
    }
    ```
    
    You can disable this behavior by setting `stripComments` to `false`.
    
    Adds a dependency on `strip-comments`, seems like a legit way of stripping comments.
    
    Rename `sandboxFileHeaders` to `sandbox.fileHeaders` to be in line with this sandbox options collection.
    
    Fixes #2364
    nicojs committed Aug 9, 2020
    Configuration menu
    Copy the full SHA
    55f27f2 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2020

  1. feat(test runner api): remove sandboxFileNames injectable values (#…

    …2369)
    
    Remove `sandboxFileNames` as injectable value for test runner plugins. Test runner plugins are expected to do their own file discovery in the current working directory. The list of sandbox files that Stryker internally copied over might differ from the list of files in the sandbox, because the user might have configured a `buildCommand` that compiled the files to their final representation.
    
    * Remove `sandboxFileNames` from dependency injection context
    * Rename `OptionsContext` to `PluginContext` and remove the `PluginContexts` mapped type (no longer needed)
    * Move generic require cache clean functionality to `@stryker-mutator/util` 
        * Use this in the mocha-runner 
        * Use this in the jasmine-runner.
    
    Fixed #2351
    nicojs committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    92f3bf5 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2020

  1. fix(core): exit process on error (#2378)

    Exit with non-zero exit code when an error occurs. 
    
    * Update typed-inject to v3 in order to dispose of the `rootInjector`
    * Rename some e2e tests to better reflect what they're testing.
    * Add an e2e test for a failing dry run. 
    
    Fixes #2315
    nicojs committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    af18a59 View commit details
    Browse the repository at this point in the history
  2. refactor(cleanup): overall cleanup of types and code style

    Bartosz Leoniak committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    2343dcf View commit details
    Browse the repository at this point in the history
  3. feat(mocha): deprecate mocha < v6 (#2379)

    BREAKING CHANGE: Mocha@<6 is deprecated and support for it will be removed in Stryker v5
    nicojs committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    fee0754 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2020

  1. fix(exit prematurely): exit when no tests were executed (#2380)

    BREAKING CHANGE: Stryker will now exit with exit code 1 when no tests were executed in the initial test run.
    nicojs committed Aug 16, 2020
    Configuration menu
    Copy the full SHA
    6885e16 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2020

  1. build(deps-dev): bump eslint from 7.6.0 to 7.7.0

    Bumps [eslint](https://github.com/eslint/eslint) from 7.6.0 to 7.7.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.6.0...v7.7.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    9f818f0 View commit details
    Browse the repository at this point in the history
  2. fix(instrumenter): support anonymous function names (#2388)

    Do a best-effort attempt to minimize side effects from instrumentation by maintaining the `fn.name` property when placing mutants in code.
    
    Instrument these:
    
    ```ts
    const foo = function () { }
    const bar = () => {}
    const Baz = class { }
    const foo = { bar: function () { } }
    ```
    
    Like this:
    
    ```ts
    const foo = true? function foo () { }: ...;
    const bar = true? (() => { const bar = () =>{}; return bar } {})() : ...;
    const Baz = true? class Baz { } : ...;
    const foo = true? function bar() {}
    ```
    
    Fixes #2362
    nicojs committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    c7d150a View commit details
    Browse the repository at this point in the history
  3. test(e2e): add jest with enzyme, react ts test

    Co-authored-by: Nico Jansen <jansennico@gmail.com>
    Garethp and nicojs committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    d31b2c6 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2020

  1. Configuration menu
    Copy the full SHA
    c7f5769 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6041699 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5ba4c5c View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2020

  1. v4.0.0-beta.3

    nicojs committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    9c2917f View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2020

  1. feat(reporter-api): support mutation switching

    Update the `Reporter` api in order to support mutation switching.
    
    * Implement `MutantResult` as a union type
    * Add `killedBy` to `KilledMutantResults`.
    * Add `errorMessage` to `InvalidMutantResult`.
    * Add the `testFilter` to `InvalidMutantResult`.
    These names are in line with the [stryker handbook](https://github.com/stryker-mutator/stryker-handbook/blob/master/mutant-states-and-metrics.md).
    
    Renamed `sourceFilePath` to `fileName` to make it more inline with the naming in the rest of the api.
    
    BREAKING CHANGE: The `onMutantTested` and `onAllMutantsTested` methods on the `Reporter` api have changed
    nicojs committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    67f1ed5 View commit details
    Browse the repository at this point in the history
  2. refactor(checker): CheckResult as union type

    Implement `CheckResult` as a union of a (passed and failed) check results.
    nicojs committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    cb71558 View commit details
    Browse the repository at this point in the history
  3. feat(test-runner): add nrOfTests metric

    Add `nrOfTests` metric to the `Survived` and `Killed` run results. This allows for calculation of the "tests per mutant metric"
    nicojs committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    0eea448 View commit details
    Browse the repository at this point in the history
  4. feat(karma-runner): force bail = true in all cases

    Force "bail" (or "failFast") for jasmine and mocha test frameworks. This should improve performance.
    nicojs committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    ba928a1 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2020

  1. build(deps-dev): bump prettier from 2.0.5 to 2.1.0

    Bumps [prettier](https://github.com/prettier/prettier) from 2.0.5 to 2.1.0.
    - [Release notes](https://github.com/prettier/prettier/releases)
    - [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
    - [Commits](prettier/prettier@2.0.5...2.1.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Aug 25, 2020
    Configuration menu
    Copy the full SHA
    0819537 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7136d54 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7528cd1 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2020

  1. chore(dev-deps): bump mutation-testing-elements (#2424)

    Bump mutation-testing-elements and related packages to `~1.4.0`.
    nicojs committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    e38360a View commit details
    Browse the repository at this point in the history
  2. feat(options): deprecate old stryker options (#2395)

    Deprecate the following stryker options:
    
    * `transpilers`
    * `mutator.name`
    * Defining `mutator` as string
    * `testFramework`
    
    Update `stryker init` to reflect these changes.
    
    Document new options in the README of stryker core.
    
    Co-authored-by: Nico Jansen <jansennico@gmail.com>
    Bartosz Leoniak and nicojs committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    7c637c8 View commit details
    Browse the repository at this point in the history
  3. build(deps-dev): bump prettier from 2.1.0 to 2.1.1

    Bumps [prettier](https://github.com/prettier/prettier) from 2.1.0 to 2.1.1.
    - [Release notes](https://github.com/prettier/prettier/releases)
    - [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
    - [Commits](prettier/prettier@2.1.0...2.1.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    7a151c4 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2020

  1. fix(input files): support emojis in file names (#2430)

    Support emojis and other encoded characters in file names when using `git ls-files`.
    nicojs committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    139f9f3 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2020

  1. Configuration menu
    Copy the full SHA
    68842ec View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    986b770 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8f96ea5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    646b15d View commit details
    Browse the repository at this point in the history
  5. feat(wct-runner): drop support for wct (#2440)

    BREAKING CHANGE: The @stryker-mutator/wct-runner package is dropped in Stryker 4.0. Please see #2386 for more details. Feel free to keep using @stryker-mutator/wct-runner@3 or start a community fork.  Note that [support for the web-component-tester itself is minimal](Polymer/tools#3398), you might want to consider switching to a different test runner. Stryker still supports Mocha, Jest, Jasmine and Karma.
    nicojs committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    7c55424 View commit details
    Browse the repository at this point in the history
  6. feat(api): rename test_runner2 -> test_runner (#2442)

    BREAKING CHANGE: Plugin creators should now use `'test_runner'` instead of `'test_runner2'`.
    nicojs committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    4d3ae97 View commit details
    Browse the repository at this point in the history
  7. feat(jest-runner): switch mutants using env (#2416)

    Pass the active mutant id through the env vars rather than config. This allows the jest transpiler files to be cached.
    
    Co-authored-by: Gareth Parker <gareth.parker@ros.gov.uk>
    Co-authored-by: Nico Jansen <jansennico@gmail.com>
    3 people committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    cad01ba View commit details
    Browse the repository at this point in the history
  8. refactor: improve typings in options validator

    Bartosz Leoniak committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    6cbe9b4 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2020

  1. v4.0.0-beta.4

    nicojs committed Aug 29, 2020
    Configuration menu
    Copy the full SHA
    bc0355e View commit details
    Browse the repository at this point in the history
  2. build(deps-dev): bump typescript from 3.9.7 to 4.0.2 (#2409)

    Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.7 to 4.0.2.
    - [Release notes](https://github.com/Microsoft/TypeScript/releases)
    - [Commits](microsoft/TypeScript@v3.9.7...v4.0.2)
    
    Small improvements to allow for ts 4
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    Co-authored-by: Nico Jansen <jansennico@gmail.com>
    dependabot-preview[bot] and nicojs committed Aug 29, 2020
    Configuration menu
    Copy the full SHA
    9c846bf View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2020

  1. Configuration menu
    Copy the full SHA
    7a3aa69 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2020

  1. build(deps-dev): bump eslint from 7.7.0 to 7.8.0

    Bumps [eslint](https://github.com/eslint/eslint) from 7.7.0 to 7.8.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.7.0...v7.8.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Sep 1, 2020
    Configuration menu
    Copy the full SHA
    d90f08a View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2020

  1. feat(typescript): Disable type checking (#2446)

    Disable type checks by inserting `// @ts-nocheck` and removing all other `// @ts-xxx` directives. 
    
    It can be configured with:
    
    ```js
    {
      "disableTypeChecks": "{test,src,lib}/**/*.{js,ts,jsx,tsx,html,vue}" // configure a pattern or `false` here
      "warnings": {
        "preprocessorErrors": true // enable/disable error logging here (default: true)
      }
    }
    ```
    
    You can disable it completely by setting `disableTypeChecks` to `false`. The default is `"{test,src,lib}/**/*.{js,ts,jsx,tsx,html,vue}"`.
    
    The disabling of type checks is done in the `DisableTypeChecksPreprocessor` class. It calls the function in the `instrumenter` package to do the actual disabling. The reason for this is that files need to be parsed to distinguish between code and comments (`@ts-xxx` directives are only removed when they appear inside comments). It also works with HTML and vue files, so it also supports use cases where type checking is done inside vue files (with the vue-cli). 
    
    Whenever parsing a file results in an error, a warning is logged and mutation testing will still proceed. The warning can be disabled by setting `warnings.preprocessorErrors` to `false`.
    
    This setting replaces both `sandbox.fileHeaders` and `sandbox.stripComments`, since those resulted in a lot of problems (see #2438 ).
    nicojs committed Sep 2, 2020
    Configuration menu
    Copy the full SHA
    3ff996b View commit details
    Browse the repository at this point in the history
  2. build(deps-dev): bump eslint from 7.8.0 to 7.8.1

    Bumps [eslint](https://github.com/eslint/eslint) from 7.8.0 to 7.8.1.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.8.0...v7.8.1)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Sep 2, 2020
    Configuration menu
    Copy the full SHA
    c9efa78 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2020

  1. feat(mutate): a new default for mutate (#2452)

    Change the default patterns for which files should be mutated to:
    
    ```json
    { 
      "mutate": [
        "{src,lib}/**/!(*.+(s|S)pec|*.+(t|T)est).+(cjs|mjs|js|ts|jsx|tsx|html|vue)", 
        "!{src,lib}/**/__tests__/**/*.+(cjs|mjs|js|ts|jsx|tsx|html|vue)"
      ]
    }
    ```
    
    Basically means any JS or friend file in the `lib` or `src` directory that isn't obviously a test file.
    
    Fixes #2384
    nicojs committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    673516d View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2020

  1. build(deps-dev): bump @typescript-eslint/eslint-plugin (#2450)

    Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 3.10.1 to 4.0.0.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.0.0/packages/eslint-plugin)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    8481e8e View commit details
    Browse the repository at this point in the history
  2. fix(reporters): correctly report avg tests/mutants (#2458)

    Correctly report the average tests/mutant metric in the clear-text reporter
    nicojs committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    582e01b View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2020

  1. fix(mocha-runner): don't allow custom timeout (#2463)

    Don't allow a custom timeout option. Stryker will decide the timeout to use for a test run.
    nicojs committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    e90b563 View commit details
    Browse the repository at this point in the history
  2. fix(mocha-runner): fix memory leaks

    Fix a memory leak that keeps required files in-memory between test runs. Properly clear the require cache by also clearing [the mocha's module children](https://nodejs.org/api/modules.html#modules_module_children). This makes sure the required files by mocha can be garbage collected.
    nicojs committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    23eede2 View commit details
    Browse the repository at this point in the history
  3. fix(jasmine-runner): fix memory leaks

    Fix a memory leak that keeps required files in-memory between test runs. Properly clear the require cache by also clearing [the jasmine's module children](https://nodejs.org/api/modules.html#modules_module_children). This makes sure the required files by jasmine can be garbage collected.
    nicojs committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    457d807 View commit details
    Browse the repository at this point in the history
  4. v4.0.0-beta.5

    nicojs committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    424036a View commit details
    Browse the repository at this point in the history
  5. test(helpers): fix a memory leak (#2468)

    Fix a memory leak in Strykers' own tests. Reuse of the `typed-inject@3` `Injector` caused essentially every object to ever be injected to be reachable and thus not garbage collectible.
    
    We're now recreating a new Injector for each test.
    nicojs committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    93039a8 View commit details
    Browse the repository at this point in the history
  6. build(deps): bump commander from 6.0.0 to 6.1.0 (#2443)

    Bumps [commander](https://github.com/tj/commander.js) from 6.0.0 to 6.1.0.
    - [Release notes](https://github.com/tj/commander.js/releases)
    - [Changelog](https://github.com/tj/commander.js/blob/master/CHANGELOG.md)
    - [Commits](tj/commander.js@v6.0.0...v6.1.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    4c1c51c View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2020

  1. fix(instrumenter): skip as expressions (#2471)

    Don't instrument TS `as` expressions as this can result in invalid code.
    nicojs committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    2432d84 View commit details
    Browse the repository at this point in the history
  2. v4.0.0-beta.6

    nicojs committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    ce1901f View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2020

  1. test(mutation): enable mutation testing (#2475)

    Enable mutation testing in the workflow again for the packages that work again 🎉
    
    Still pending: mocha-runner,  jasmine-runner (#2473) and karma-runner (#2474).
    
    Closes #2426
    nicojs committed Sep 13, 2020
    Configuration menu
    Copy the full SHA
    ddb6c3d View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2020

  1. build(deps-dev): bump eslint from 7.8.1 to 7.9.0

    Bumps [eslint](https://github.com/eslint/eslint) from 7.8.1 to 7.9.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.8.1...v7.9.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Sep 14, 2020
    Configuration menu
    Copy the full SHA
    632f030 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2020

  1. build(deps-dev): bump prettier from 2.1.1 to 2.1.2

    Bumps [prettier](https://github.com/prettier/prettier) from 2.1.1 to 2.1.2.
    - [Release notes](https://github.com/prettier/prettier/releases)
    - [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
    - [Commits](prettier/prettier@2.1.1...2.1.2)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Sep 16, 2020
    Configuration menu
    Copy the full SHA
    472cff2 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2020

  1. fix(instrumenter): place mutants in if statements (#2481)

    Place mutants in a statement with an `if` statement instead of a `switch` statement.
    
    Fixes #2469
    nicojs committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    4df4102 View commit details
    Browse the repository at this point in the history
  2. fix(instrumenter): don't mutate constructor blocks with initialized c…

    …lass properties (#2484)
    
    Don't mutate constructor block statements when the class contains initialized class properties. For example:
    
    ```ts
    class Foo extends Baz {
      bar = 'bar';
      constructor() {  // Don't mutate this block!
         super();
      }
    }
    ```
    
    If you mutate the constructor block above, and TypeScript transpiles the code, it will call `this.bar` before the `super()` is initiated. Resulting in a runtime error.
    
    Fixes #2474
    nicojs committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    ca464a3 View commit details
    Browse the repository at this point in the history
  3. fix(core): allow skipped tests when matching mutants (#2487)

    Allow for a coverage per test result for a non-existing test. This can happen when you add a `this.skip` inside a `it`. In that case, `beforeEach` still executes and can add test coverage.
    
    We now ignore simply ignore this and log a debug message.
    
    Fixes #2485
    nicojs committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    09eacee View commit details
    Browse the repository at this point in the history
  4. v4.0.0-beta.7

    nicojs committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    5bf235d View commit details
    Browse the repository at this point in the history
  5. feat(core): add --cleanTempDir cli option

    Add `--cleanTempDir` cli option. When set to `true` (default), it will remove the `.stryker-tmp` directory on a successful run. If `false` it will never remove the directory. Note: the directory will never be deleted when an error occurred.
    Bartosz Leoniak committed Sep 17, 2020
    Configuration menu
    Copy the full SHA
    6ef792c View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2020

  1. Configuration menu
    Copy the full SHA
    15bb4d1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cfd006e View commit details
    Browse the repository at this point in the history
  3. refactor(instrumenter): use global namespace

    Introduce instrumenting files with a global namespace for everything related to stryker.
    
    This:
    
    ```ts
    global.__activeMutant__: number | undefined;
    global.__currentTestId__: string | undefined;
    global.__mutantCoverage__: MutantCoverage | undefined;
    ```
    
    Is now this:
    
    ```ts
    global.__stryker__ = {
      activeMutant: number | undefined;
      currentTestId: string | undefined;
      mutantCoverage: MutantCoverage | undefined;
    }
    ```
    
    Also refactored the instrumenter syntax at the top of each file.
    
    This:
    
    ```ts
    const foo = __global_69fa48.__activeMutant__ === 1 ? bar >>> baz
    ```
    
    Becomes
    
    ```ts
    const foo = stryMutAct_9fa48(1) ? bar >>> baz
    ```
    nicojs committed Sep 21, 2020
    Configuration menu
    Copy the full SHA
    2b01d5c View commit details
    Browse the repository at this point in the history
  4. test(mutation): enable stryker run on mocha-runner

    Enable running stryker on `@stryker-mutator/mocha-runner`. In order for the `__stryker__` global variable to not interfere with the tests, inject `__stryker2__` as global namespace in unit and integration tests.
    nicojs committed Sep 21, 2020
    Configuration menu
    Copy the full SHA
    b27699b View commit details
    Browse the repository at this point in the history
  5. test(mutation): enable stryker on jasmine-runner

    Enable running stryker on `@stryker-mutator/jasmine-runner`. In order for the `__stryker__` global variable to not interfere with the tests, inject `__stryker2__` as global namespace in unit and integration tests.
    nicojs committed Sep 21, 2020
    Configuration menu
    Copy the full SHA
    12be994 View commit details
    Browse the repository at this point in the history
  6. feat(instrumenter): improve placement error

    Improve the invalid mutant placement error using `nodePath.buildCodeFrameError`.
    
    This:
    
    > Stryker Error: Error while placing mutants of type(s) "StringLiteral" on 52:15 with expressionMutantPlacer. TypeError: Property id of DeclareModule expected node to be of a type ["Identifier","StringLiteral"] but instead got "SequenceExpression"
    
    Becomes:
    > SyntaxError: packages/react-devtools-extensions/flow-typed/npm/react-test-renderer_v16.x.x.js:52:15 expressionMutantPlacer could not place mutants with type(s): "StringLiteral". Either remove this file from the list of files to be mutated, or ignore the mutators. Please report this issue at https://github.com/stryker-mutator/stryker/issues/new?assignees=&labels=%F0%9F%90%9B+Bug&template=bug_report.md&title=expressionMutantPlacer%20could%20not%20place%20mutants%20with%20type(s)%3A%20%22StringLiteral%22.
    >   50 | };
    >   51 |
    > > 52 | declare module 'react-test-renderer' {
    >      |                ^^^^^^^^^^^^^^^^^^^^^
    >   53 |   // eslint-disable-next-line no-inner-declarations
    >   54 |   declare export type ReactTestRenderer = {
    >   55 |     toJSON(): null | ReactTestRendererJSON,
    nicojs committed Sep 21, 2020
    Configuration menu
    Copy the full SHA
    12e097e View commit details
    Browse the repository at this point in the history
  7. fix(instrumenter): ignore declare syntax

    Ignore `declare` syntax in flow and ts files when instrumenting the code. Some examples:
    
    ```js
    declare module 'react-test-renderer' {
      // eslint-disable-next-line no-inner-declarations
    }
    declare type ReactTestRenderer = {
    };
    
    declare type Thenable = {
    };
    
    declare function create(
    ): ReactTestRenderer;
    
    declare function act(callback: () => ?Thenable): Thenable;
    
    declare const foo: string;
    declare function bar(): 'bar';
    ```
    nicojs committed Sep 21, 2020
    Configuration menu
    Copy the full SHA
    b1faa16 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2020

  1. test(e2e): add e2e test for coverage analysis (#2491)

    Add e2e test for coverage analysis `off`, `all` and `perTest`.
    nicojs committed Sep 22, 2020
    Configuration menu
    Copy the full SHA
    d8d5514 View commit details
    Browse the repository at this point in the history
  2. v4.0.0-beta.8

    nicojs committed Sep 22, 2020
    Configuration menu
    Copy the full SHA
    4a82553 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2020

  1. feat(core): add appendPlugins command-line option (#2385)

    Add `--appendPlugins` command-line option that can append plugins without overriding the (default) `plugins`. This is a way for tools to add plugins without affecting anything else.
    Garethp committed Sep 25, 2020
    Configuration menu
    Copy the full SHA
    0dec9b8 View commit details
    Browse the repository at this point in the history
  2. build(deps-dev): bump @types/inquirer from 6.0.3 to 7.3.1 (#2408)

    * build(deps-dev): bump @types/inquirer from 6.0.3 to 7.3.1
    
    Bumps [@types/inquirer](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/inquirer) from 6.0.3 to 7.3.1.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/inquirer)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    * Fix minor typing issues
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    Co-authored-by: Nico Jansen <jansennico@gmail.com>
    dependabot-preview[bot] and nicojs committed Sep 25, 2020
    Configuration menu
    Copy the full SHA
    5ff6109 View commit details
    Browse the repository at this point in the history
  3. feat(jest-runner): deprecate "create-react-app-ts" (#2497)

    Deprecate the use of `"projectType": "create-react-app-ts"`. Support will be removed in Stryker 5. Please follow the official [migration guide](https://create-react-app.dev/docs/adding-typescript/) and use `"projectType": "create-react-app"`
    
    Co-authored-by: Nico Jansen <jansennico@gmail.com>
    simondel and nicojs committed Sep 25, 2020
    Configuration menu
    Copy the full SHA
    0aacc7b View commit details
    Browse the repository at this point in the history
  4. fix(core): fix "too many open files" (#2498)

    * fix(core): fix "too many open files"
    
    Fixes "too many open files" issue by limitting the number of concurrent file IO to 256
    
    * One liner await
    
    * fix unit test
    
    * test(input-file): don't rely on os ordering
    
    * Remove `.only`
    
    * deterministic order of mutants
    nicojs committed Sep 25, 2020
    Configuration menu
    Copy the full SHA
    5b7c242 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c8dcecd View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2020

  1. fix(config): deprecate function based config (#2499)

    add deprecation warning for function based config
    
    BREAKING CHANGE: exporting a function from stryker.conf.js is deprecated. Please export your config as an object instead, or use a stryker.conf.json file.
    
    Co-authored-by: Nico Jansen <jansennico@gmail.com>
    Bartosz Leoniak and nicojs committed Sep 26, 2020
    Configuration menu
    Copy the full SHA
    8ea3c18 View commit details
    Browse the repository at this point in the history
  2. fix(instrumenter): only add header when there are mutats (#2503)

    Only add the JS header for files that have mutants. For example: don't add it in *.d.ts files.
    nicojs committed Sep 26, 2020
    Configuration menu
    Copy the full SHA
    8f989cc View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2020

  1. build(deps-dev): bump eslint from 7.9.0 to 7.10.0

    Bumps [eslint](https://github.com/eslint/eslint) from 7.9.0 to 7.10.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.9.0...v7.10.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    efc812d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ee0615d View commit details
    Browse the repository at this point in the history
  3. feat(core): correct initial test run timing (#2496)

    Correctly report the initial test run timing. For example:
    
    > `INFO DryRunExecutor Initial test run succeeded. Ran 502 tests in 2 seconds (net 2295 ms, overhead 572 ms)`
    
    Co-authored-by: root <root@SimonL03.corp.infosupport.com>
    Co-authored-by: Nico Jansen <jansennico@gmail.com>
    3 people committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    4f5a37e View commit details
    Browse the repository at this point in the history
  4. chore: update database

    hugo-vrijswijk committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    b33dc72 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    76bb1ba View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    66c2444 View commit details
    Browse the repository at this point in the history
  7. fix(shebang): support shebang in in files (#2510)

    Support shebang (i.e. `#!/usr/bin/env node`) in javascript files.
    nicojs committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    7d2dd80 View commit details
    Browse the repository at this point in the history
  8. feat(test-runner): Add --maxTestRunnerReuse support

    Add support for `--maxTestRunnerReuse` compiler flag (and equivalent in stryker.conf.json). With it, you can specify the maximum number that a test runner can be reused before the process is killed and a new one is created. The default is `0`, which means no maximum, just keep reusing.
    
    There are 2 use cases for this setting.
    
    1. You have a memory leak in your tests that cannot be fixed (for example, a plugin in jest). You run with `--maxTestRunnerReuse 20`.
    2. Your environment is dirty after running one time and you cannot do anything about it. You run with `--maxTestRunnerReuse 1`.
    Garethp committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    5919484 View commit details
    Browse the repository at this point in the history
  9. test(angular): enable Angular performance test (#2511)

    * Upgrade angular core to v9.
    * Update stryker.conf.json
    simondel committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    521f0aa View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2020

  1. Configuration menu
    Copy the full SHA
    990d407 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2020

  1. v4.0.0-beta.9

    nicojs committed Sep 30, 2020
    Configuration menu
    Copy the full SHA
    e665052 View commit details
    Browse the repository at this point in the history
  2. build(deps-dev): bump sinon from 9.0.3 to 9.1.0

    Bumps [sinon](https://github.com/sinonjs/sinon) from 9.0.3 to 9.1.0.
    - [Release notes](https://github.com/sinonjs/sinon/releases)
    - [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
    - [Commits](sinonjs/sinon@v9.0.3...v9.1.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Sep 30, 2020
    Configuration menu
    Copy the full SHA
    7616d84 View commit details
    Browse the repository at this point in the history
  3. build(deps-dev): bump flatted from 3.0.5 to 3.1.0

    Bumps [flatted](https://github.com/WebReflection/flatted) from 3.0.5 to 3.1.0.
    - [Release notes](https://github.com/WebReflection/flatted/releases)
    - [Commits](WebReflection/flatted@v3.0.5...v3.1.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Sep 30, 2020
    Configuration menu
    Copy the full SHA
    4270117 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2020

  1. refactor: remove unused file (#2524)

    Bartosz Leoniak committed Oct 2, 2020
    Configuration menu
    Copy the full SHA
    3eef8aa View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2020

  1. fix(instrumenter): switch case mutant placer (#2518)

    Add a `MutantPlacer` for `SwitchCase` nodes. It places the mutants in the `consequence` part of the switch case. This can dramatically improve the performance of instrumenting large switch-case statements.
    
    This:
    
    ```js
    switch(foo){
      case 'bar':
        console.log('bar');
        break;
      case 'baz':
        console.log('baz');
        break;
    
    }
    ```
    
    Is now instrumented as:
    
    ```js
    switch (foo) {
      case stryMutAct_9fa48(1) ? \\"\\" : (stryCov_9fa48(1), 'bar'):
        if (stryMutAct_9fa48(0)) {} else {
          stryCov_9fa48(0);
          console.log(stryMutAct_9fa48(2) ? \\"\\" : (stryCov_9fa48(2), 'bar'));
          break;
        }
    
      case stryMutAct_9fa48(4) ? \\"\\" : (stryCov_9fa48(4), 'baz'):
        if (stryMutAct_9fa48(3)) {} else {
          stryCov_9fa48(3);
          console.log(stryMutAct_9fa48(5) ? \\"\\" : (stryCov_9fa48(5), 'baz'));
          break;
        }
    }
    ```
    
    While previously the entire `SwitchCaseExpression` was duplicated for each empty switch case mutation.
    nicojs committed Oct 4, 2020
    Configuration menu
    Copy the full SHA
    a560711 View commit details
    Browse the repository at this point in the history
  2. feat(instrumenter): add excludedMutations support (#2513)

    Add support to configure `mutator.excludedMutations`. This was already supported in Stryker@<3, but not yet in Stryker4 beta.
    
    Instead of not generating the mutants, it generates them without placing them in the code. They get reported as `ignored` in your mutation testing report.
    
    ![image](https://user-images.githubusercontent.com/1828233/94722119-2142dc00-0357-11eb-839c-a4aef430dcea.png)
    
    Also, add error message, ignore reason, and "killed by" test name in the "show more" modal dialog.
    
    ![image](https://user-images.githubusercontent.com/1828233/94722368-8565a000-0357-11eb-9a2d-05be1ac0d161.png)
    nicojs committed Oct 4, 2020
    Configuration menu
    Copy the full SHA
    bfd714f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    01bbdda View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2020

  1. v4.0.0-beta.10

    nicojs committed Oct 5, 2020
    Configuration menu
    Copy the full SHA
    373ca28 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2020

  1. Configuration menu
    Copy the full SHA
    389d9f8 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2020

  1. fix(presets): update init templates for 4.0 release (#2526)

    * Update the vuejs, react, angular and vue presets for the 4.0 release.
    * Remove `@stryker-mutator/core` from presets
    nicojs committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    ec0d75e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6a3a993 View commit details
    Browse the repository at this point in the history
  3. fix(instrumenter): don't mutate generics (#2530)

    Don't mutate `TSTypeParameterInstantiation` like `React.useState<true>()`
    nicojs committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    ed42e3c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e632d1e View commit details
    Browse the repository at this point in the history