Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
@stryker-mutator/api
Advanced tools
The api for the extendable JavaScript mutation testing framework Stryker
@stryker-mutator/api is a part of the Stryker Mutator framework, which is used for mutation testing in JavaScript and TypeScript projects. It provides a set of APIs that allow developers to integrate and extend the mutation testing capabilities of Stryker.
Mutator API
The Mutator API allows developers to create custom mutators that define how code should be mutated during testing. This is useful for extending the mutation testing capabilities to cover more specific or custom scenarios.
const { Mutator } = require('@stryker-mutator/api/mutant');
class MyMutator extends Mutator {
mutate(node) {
// Custom mutation logic
}
}
Reporter API
The Reporter API provides a way to create custom reporters that can handle and display the results of mutation testing. This allows for customized reporting formats and integration with other tools.
const { Reporter } = require('@stryker-mutator/api/report');
class MyReporter extends Reporter {
onMutantTested(result) {
console.log(`Mutant ${result.id} tested with status ${result.status}`);
}
}
Test Framework API
The Test Framework API allows developers to integrate custom test frameworks with Stryker. This is useful for supporting additional testing frameworks that are not natively supported by Stryker.
const { TestFramework } = require('@stryker-mutator/api/test_framework');
class MyTestFramework extends TestFramework {
constructor() {
super();
// Custom test framework initialization
}
}
Jest is a popular JavaScript testing framework with built-in support for snapshot testing, mocking, and more. While it does not focus on mutation testing like Stryker, it provides a comprehensive testing solution that can be used alongside Stryker for a complete testing strategy.
Mocha is a flexible JavaScript test framework for Node.js programs. It provides a simple and extensible interface for writing tests, but does not include mutation testing capabilities. Mocha can be used with Stryker to perform mutation testing on tests written in Mocha.
Karma is a test runner that allows you to execute JavaScript code in multiple real browsers. It is often used in conjunction with other testing frameworks like Jasmine or Mocha. While Karma itself does not provide mutation testing, it can be integrated with Stryker to run mutation tests in a browser environment.
This is the repository for maintaining the API of the Stryker JavaScript mutation testing framework. Plugin creators should depend on this API rather than on the main Stryker repository directly.
You can extend Stryker in a number of ways.
Mutator
Reporter
TestFramework
for a test frameworkTestRunner
to bridge the gap between your test runner and StrykerOptionsEditor
All extension points work in the same basic way.
constructor function
(or class
)constructor function
to the correct Factory
.For more info, please take a look at the Stryker handbook.
4.5.0 (2021-03-06)
FAQs
The api for the extendable JavaScript mutation testing framework Stryker
The npm package @stryker-mutator/api receives a total of 124,656 weekly downloads. As such, @stryker-mutator/api popularity was classified as popular.
We found that @stryker-mutator/api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.