VueJS
Stryker supports Vue projects. It can mutate both your js/ts files as the script tags in your *.vue files.
This article will explain how to configure Stryker with vue.
To get started using Stryker with vue, first install the core package: npm i -D @stryker-mutator/core or yarn add --dev @stryker-mutator/core. Next follow the guide for the Vitest runner.
Keep in mind that you may have to change some configuration settings such as paths to files.
Vitest configuration​
- Install the
@stryker-mutator/vitest-runnerplugin:npm i -D @stryker-mutator/vitest-runneroryarn add --dev @stryker-mutator/vitest-runner. - Create a "stryker.config.json" file that looks like this:
{
"$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
"testRunner": "vitest",
"plugins": ["@stryker-mutator/vitest-runner"]
} - Add this script to your package.json:
{
"scripts": {
"test:mutation": "stryker run"
}
}
Now give it a go with npm run test:mutation or yarn test:mutation.
Please take a look at the troubleshooting page when you run into any problems setting up StrykerJS.