Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Professor X: For someone who hates mutants... you certainly keep some strange company.
William Stryker: Oh, they serve their purpose... as long as they can be controlled.
This repository is a work in progress. We only support Jasmine tests in the browser for now. Please create and vote on issues to help us determine the priority on features.
Stryker is a mutation testing framework for JavaScript. It allows you to test your test by temporarily inserting bugs.
To install stryker, execute the command:
npm install stryker --save-dev
Note*: During the installation you may run into errors caused by node-gyp. It is safe to ignore these errors.*
To test if stryker is working, execute the command:
node node_modules/stryker/dist/src/Stryker.js --help
Short notation: -m
Full notation: --mutate
Optional: No
Description:
A comma seperated list of globbing expressions used for selecting the files that should be mutated.
Example: -m src/**/*.js,a.js`
Short notation: -f
Full notation: --files
Optional: No
Description:
A comma seperated list of globbing expressions used for selecting all files needed to run the tests.
These include: test files, library files, source files (the files selected with --mutate
) and any other file you need to run your tests.
The order of the files specified here will be the order used to load the file in the test runner, for example: karma.
Example: -f node_modules/a-lib/**/*.js,src/**/*.js,a.js,test/**/*.js
By default, stryker requires two arguments: the source and test files.
When calling stryker with multiple source and/or test files, they have to be separated using comma's.
A basic usage of stryker is:
node node_modules/stryker/src/Stryker.js –m src/myFirstFile.js,src/mySecondFile.js –f libs/externalLibrary.js,src/myFirstFile.js,src/mySecondFile.js,test/*.js,
Original | Mutated |
---|---|
a + b | a - b |
a - b | a + b |
a * b | a / b |
a / b | a * b |
a & b | a * b |
Original | Mutated |
---|---|
a++ | a-- |
a-- | a++ |
++a | --a |
--a | ++a |
+a | -a |
-a | +a |
Original | Mutated |
---|---|
a < b | a <= b |
a <= b | a < b |
a > b | a >= b |
a >= b | a < b |
Original | Mutated |
---|---|
a == b | a != b |
a != b | a == b |
a === b | a !== b |
a !== b | a === b |
a <= b | a > b |
a >= b | a < b |
a < b | a >= b |
a > b | a <= b |
a && b | a || b |
a || b | a && b |
Original | Mutated |
---|---|
for (var i = 0; i < 10; i++) { } | for (var i = 0; false; i++) { } |
while (a > b) { } | while (false) { } |
do { } while (a > b); | do { } while (false); |
if (a > b) { } | if (true) { } |
if (a > b) { } | if (false) { } |
FAQs
The extendable JavaScript mutation testing framework
The npm package stryker receives a total of 686 weekly downloads. As such, stryker popularity was classified as not popular.
We found that stryker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.