Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Commit

Permalink
feat(Jest-runner): support jest configuration (#25)
Browse files Browse the repository at this point in the history
Support configurable options using the `jest` property in your stryker config:

``` js
jest: {
    project: 'react', // or 'default'
    config: require('path/to/your/custom/jestConfig.js') 
}
```

When neither of the options are specified, the jest config in your `package.json` file is used.

To support reading jest configuration, we are now using a higher level jest api, the `jest-cli`, to start the tests. In order to keep it in a single process, the `run-in-band` option is provided, forcing jest to run inside the parent process.
  • Loading branch information
Sander Koenders authored and nicojs committed Feb 6, 2018
1 parent e347f89 commit 630b60b
Show file tree
Hide file tree
Showing 70 changed files with 1,619 additions and 997 deletions.
4 changes: 4 additions & 0 deletions .bettercodehub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
component_depth: 1
languages:
- javascript
- typescript
2 changes: 1 addition & 1 deletion .bithoundrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"test/**",
"testResources/**"
]
}
}
28 changes: 12 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
node_modules
npm-debug.log
debug.log
coverage
.tscache
/resources
typings
*.js.map
src/**/*.js
test/**/*.js
src/**/*.d.ts
test/**/*.d.ts
!Gruntfile.js
!*.conf.js
!testResources
reports
.idea
/node_modules
**/*.js
**/*.js.map
**/*.d.ts

!testResources/**/*.js
!stryker.conf.js
/package-lock.json
/reports
/.nyc_output
.stryker-tmp
18 changes: 9 additions & 9 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
*.ts
**/*
!*.d.ts
Gruntfile.js
test
tsconfig.json
typings.json
testResources
typings
.vscode
*.png
!bin/**
!src/**
src/**/*.map
src/**/*.ts
!src/**/*.d.ts
!README.md
!LICENSE
!CHANGELOG.md
22 changes: 10 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
language: node_js
node_js:
- "7"
- "6"
env:
- JEST_VERSION=18.0.0
- JEST_VERSION=19.0.0
- JEST_VERSION=20.0.0
- JEST_VERSION=21.0.0
- node
- 'lts/*'
- '6'
- '4'
install: npm install
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# Install desired version of Jest
- npm i -D jest@${JEST_VERSION} jest-cli@${JEST_VERSION}
before_install:
- if [[ `npm -v` = 2* ]]; then npm i -g npm@3; fi
notifications:
email:
on_success: never
on_failure: change
143 changes: 22 additions & 121 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,123 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run unit tests",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/grunt/bin/grunt",
// "preLaunchTask": "build",
"stopOnEntry": false,
"args": [
"mochaTest:unit"
],
"cwd": "${workspaceRoot}/.",
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}"
},
{
"name": "Run integration tests",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/grunt-cli/bin/grunt",
// "preLa4unchTask": "ts",
"stopOnEntry": false,
"args": [
"mochaTest:integration"
],
"cwd": "${workspaceRoot}/.",
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}"
},
{
"name": "Run stryker example",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/bin/stryker",
"preLaunchTask": "build",
"stopOnEntry": false,
"args": [
"--configFile",
"testResources/sampleProject/stryker.conf.js",
"--logLevel",
"trace",
"--testFramework",
"jasmine"
],
"cwd": "${workspaceRoot}",
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}"
},
{
"name": "Run own dog food",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/bin/stryker",
"preLaunchTask": "build",
"stopOnEntry": false,
"args": [
"--configFile",
"stryker.conf.js",
"--logLevel",
"info"
],
"cwd": "${workspaceRoot}",
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}"
},
{
"name": "Run stryker help",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/Stryker.js",
"preLaunchTask": "build",
"stopOnEntry": false,
"args": [
"--help"
],
"cwd": "${workspaceRoot}/.",
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}"
}
]
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Integration tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/helpers/**/*.js",
"${workspaceFolder}/test/integration/**/*.js"
],
"internalConsoleOptions": "openOnSessionStart"
}
]
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"files": {
"exclude": {
".git": "",
".tscache": "",
"**/*.js": {
"when": "$(basename).ts"
},
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,3 @@
* fix(README): Fix Travis Badge pointing to the wrong repo ([9177447](https://github.com/stryker-mutator/stryker-jest-runner/commit/9177447))



49 changes: 0 additions & 49 deletions CONTRIBUTING.md

This file was deleted.

0 comments on commit 630b60b

Please sign in to comment.