Skip to main content

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​

  1. Install the @stryker-mutator/vitest-runner plugin: npm i -D @stryker-mutator/vitest-runner or yarn add --dev @stryker-mutator/vitest-runner.
  2. 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"]
    }
  3. 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.