Stryker supports VueJS projects that use the vue-template-compiler.
All configurations will require at least the vue-template-compiler 2.0.0 or higher.
To get started using VueJS, please follow these steps:
- Install the recommended packages for all VueJS projects:
npm i -D @stryker-mutator/core @stryker-mutator/vue-mutator @stryker-mutator/html-reporter
- Execute
npm i -D @stryker-mutator/javascript-mutator
for JavaScript projects ornpm i -D @stryker-mutator/typescript
for TypeScript projects - Execute
npm i -D @stryker-mutator/karma-runner
for Karma projects ornpm i -D @stryker-mutator/jest-runner
for Jest projects - Create a stryker.conf.js file and configure it using the settings below
Keep in mind that you may have to change some configuration settings such as paths to files.
The following config is a good starting point, but keep in mind that you may have to change the browsers config. We highly suggest using a headless browser when testing using stryker.
module.exports = function (config) {
config.set({
mutate: ['src/**/*.js', 'src/**/*.ts', 'src/**/*.vue'],
mutator: 'vue',
testRunner: 'karma',
karma: {
configFile: 'test/unit/karma.conf.js',
config: {
browsers: ['ChromeHeadless']
}
},
reporter: ['progress', 'clear-text', 'html'],
coverageAnalysis: 'off'
});
};
The following config is a good starting point, the stryker-jest-runner will attempt to find your config file by looking in your package.json and in the current working directory.
If your jest config is somewhere else, please specify it.
module.exports = function (config) {
config.set({
mutate: ['src/**/*.js', 'src/**/*.ts', 'src/**/*.vue'],
mutator: 'vue',
testRunner: 'jest',
jest: {
// config: require('path/to/your/custom/jestConfig.js')
}
reporter: ['progress', 'clear-text', 'html'],
coverageAnalysis: 'off'
});
};