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

test: setup stryker mutation testing #183

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ node_modules/
.DS_Store
lib/**/*.d.ts
test/**/*.d.ts
.stryker-tmp/
reports/
*.log
yarn.lock
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"vfile": "^5.0.0"
},
"devDependencies": {
"@stryker-mutator/core": "^5.0.0",
"@types/extend": "^3.0.0",
"@types/tape": "^4.0.0",
"c8": "^7.0.0",
Expand All @@ -73,7 +74,8 @@
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node --unhandled-rejections=strict --conditions development test/index.js",
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node --unhandled-rejections=strict --conditions development test/index.js",
"test": "npm run build && npm run format && npm run test-coverage"
"test-mutation": "npx stryker run",
"test": "npm run build && npm run format && npm run test-coverage && npm run test-mutation"
},
"prettier": {
"tabWidth": 2,
Expand Down
11 changes: 11 additions & 0 deletions stryker.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
"packageManager": "npm",
"reporters": ["html", "clear-text", "progress"],
"mutate": ["lib/index.js"],
"testRunner": "command",
"coverageAnalysis": "off",
"commandRunner": {"command": "npm run test-api"},
"timeoutFactor": 3,
"thresholds": {"break": 100}
}