This extension provides seamless integration with mutation testing frameworks that support the Mutation Server Protocol. Currently, only StrykerJS supports this protocol. With StrykerJS, you can run mutation tests on most JavaScript projects, including TypeScript, React, Angular, VueJS, Svelte, and NodeJS.
This extension allows you to easily run mutation tests directly within Visual Studio Code. With this extension, you can quickly identify weak spots in your codebase and improve the overall quality of your projects.
Mutation testing introduces bugs, or mutants to your code, then your tests are run for each mutant. It is expected that your tests will now fail. If your tests fail then the mutant is killed. If your tests passed, the mutant survived. If you have survived mutants, it might indicate your tests do not sufficiently cover the code. The higher the percentage of mutants killed, the more effective your tests are.
Take a look at StrykerJS' introduction page on mutation testing.
Effortlessly navigate through mutants in your project via the Test Explorer view. Find mutants and run mutation tests per folder, per file or individually. Get visual feedback on the status of mutants within your code and easily navigate to mutants in your codebase directly from the Test Explorer.
Easily test mutations right where they're written using the test icon in your code editor. You'll see the status of each tested mutation right next to your code. Plus, with the code diff view, you can quickly spot the changes Stryker made to your code.
To use this extension, ensure that you have StrykerJS installed in your project, or setup a different mutation server via the extension settings.
This extension contributes the following settings:
stryker-mutator.mutationServerExecutablePathOverwrite
: Overwrite the path to the mutation server executable.- By default the extension will look for StrykerJS' mutation server in your project's
node_modules\.bin
folder.
- By default the extension will look for StrykerJS' mutation server in your project's
stryker-mutator.mutationServerPort
: Set the port on which the mutation server will run.- By default the extension will use a random available port on your system.
stryker-mutator.mutationServerTimeout
: Set the timeout in milliseconds for the mutation server to start.- By default the timeout will be a minute.
stryker-mutator.configFilePathOverwrite
: Set the path to your mutation testing framework's configuration file.- By default the mutation testing framework will try to detect the location of your config file.
After changing any settings, reload your VS Code window to apply the changes.
We’d love to get your help in making this extension better! If you have feedback or encounter any problems, please reach out on our GitHub repository.