Skip to content

Commit

Permalink
Merge branch 'master' into epic/v5
Browse files Browse the repository at this point in the history
  • Loading branch information
nicojs committed Apr 16, 2021
2 parents c19095e + 9127a83 commit c610223
Show file tree
Hide file tree
Showing 89 changed files with 1,571 additions and 227 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
},
root: true,
parser: '@typescript-eslint/parser',
extends: ['plugin:@typescript-eslint/all', 'prettier', 'prettier/@typescript-eslint'],
extends: ['plugin:@typescript-eslint/all', 'prettier'],
plugins: ['@typescript-eslint', 'prettier', 'import', 'unicorn'],
rules: {
// unicorn rules
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.6.0](https://github.com/stryker-mutator/stryker-js/compare/v4.5.1...v4.6.0) (2021-04-16)


### Features

* **mutation range:** allow specifying a mutation range ([#2751](https://github.com/stryker-mutator/stryker-js/issues/2751)) ([84647cf](https://github.com/stryker-mutator/stryker-js/commit/84647cf8c4052dead95d4d23a0e9c0c66e54292c))
* **rename:** rename to StrykerJS ([#2813](https://github.com/stryker-mutator/stryker-js/issues/2813)) ([dc08592](https://github.com/stryker-mutator/stryker-js/commit/dc08592c09c0fe5fcc21db03dc2da4e03713f46b)), closes [#2754](https://github.com/stryker-mutator/stryker-js/issues/2754)





## [4.5.1](https://github.com/stryker-mutator/stryker/compare/v4.5.0...v4.5.1) (2021-03-11)


Expand Down
18 changes: 17 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Please adhere to our [editorconfig](https://editorconfig.org) and [eslint](https

We configured the tslint extension to run on save in or [vscode workspace](#vscode-environment-configuration).

## Runner StrykerJS locally
## Running StrykerJS locally

We use [Lerna](https://lerna.js.org/) to manage the packages in this repository. You don't have to install it globally. The packages themselves can be found in the [packages folder](https://github.com/stryker-mutator/stryker-js/tree/master/packages). Commands such as `npm test` can be executed from the root of the project but executing them inside of a package folder is more time efficient. However, we suggest running `npm test` in the root of the project before a commit to ensure that everything still works. To get Stryker running locally, please follow these steps:

Expand All @@ -42,6 +42,22 @@ Here are some common tasks to use. Just remember that they don't include compili
* Use `npm run e2e` will install and execute the end to end tests (located in the e2e folder). These take a while.
* Use `npm run perf` will install and execute the performance tests (located in the perf folder). These take a while.

To run local changes you made in StrykerJS in an actual project you have two options:
1. You can use [install-local](https://www.npmjs.com/package/install-local) to install StrykerJS with plugins in your project. Don't forget to include `instrumenter`, `core`, `util` and `api` in each install. For example, if you want to install Stryker with the jest-runner:
```sh
cd my-project
npx install-local ../stryker-js/packages/core ../stryker-js/packages/util ../stryker-js/packages/api ../stryker-js/packages/instrumenter ../stryker-js/packages/jest-runner
```
2. You can simply cd into your test project, add your plugin inside `"plugins"` configurtion and run Stryker from the command line. For example:
```sh
cd my-project
open stryker.conf.json
# Add `"plugins": ["/home/username/stryker-js/packages/jest-runner"]` inside the stryker.conf.json
/home/username/stryker-js/packages/core/bin/stryker run
```
This way you can also debug from vscode using the "Attach" configuration and running Stryker from `my-project` like this: `node --inspect-brk /home/username/stryker-js/packages/core/bin/stryker run`.


## VSCode environment configuration

We've chosen to **check in in our vscode configuration**. This makes development unified amongst stryker developers. VSCode is an open source code editor maintained by Microsoft. For more info and the download link, please visit https://code.visualstudio.com/.
Expand Down
15 changes: 12 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,18 @@ Default: `['{src,lib}/**/*.js?(x)', '!{src,lib}/**/__tests__/**/*.js?(x)', '!{sr
Command line: `[--mutate|-m] src/**/*.js,a.js`<br />
Config file: `"mutate": ["src/**/*.js", "a.js"]`

With `mutate` you configure the subset of files to use for mutation testing.
Generally speaking, these should be your own source files.
This is optional, as you can choose to not mutate any files at all and perform a dry-run (running only your tests without mutating).
With `mutate` you configure the subset of files to be mutated. These should be your _production code files_, and definitely not your test files.
The default will try to guess your production code files based on sane defaults. It reads like this:

* Include all js-like files inside the `src` or `lib` dir
* Except files inside `__tests__` directories and file names ending with `test` or `spec`.

It is possible to specify exactly which code blocks to mutate by means of a _mutation range_. This can be done postfixing your file with `:startLine[:startColumn]-endLine[:endColumn]`. Some examples:
* `"src/app.js:1-11"` will mutate lines 1 through 11 inside app.js.
* `"src/app.js:5:4-6:4"` will mutate from line 5, column 4 through line 6 column 4 inside app.js (columns 4 are included).
* `"src/app.js:5-6:4"` will mutate from line 5, column 0 through line 6 column 4 inside app.js (column 4 is included).

*Note:* It is not possible to combine mutation range with a globbing expression in the same line.

### `mutator` [`MutatorDescriptor`]

Expand Down
2 changes: 1 addition & 1 deletion docs/jest-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Configure where jest should get its configuration from.
* `"create-react-app"`: use [react-scripts](https://www.npmjs.com/package/react-scripts), for projects created with [create-react-app](https://github.com/facebook/create-react-app).
* `"create-react-app-ts"`: **DEPRECATED** use [react-scripts-ts](https://www.npmjs.com/package/react-scripts-ts), for projects created with [create-react-app-typescript](https://github.com/wmonk/create-react-app-typescript). DEPRECATED, please [follow the migration guide](https://create-react-app.dev/docs/adding-typescript/) and move to `create-react-app`.

### `jest.configFile`] [`string`]
### `jest.configFile` [`string`]

Default: `undefined`

Expand Down
4 changes: 4 additions & 0 deletions e2e/test/mutation-range/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
Loading

0 comments on commit c610223

Please sign in to comment.