Skip to content

Conversation

dantesb777
Copy link

🔧 Setup Stryker Mutation Testing
Summary

This PR adds Stryker mutation testing to the project to help ensure the robustness of the test suite.

Changes made:

Installed @stryker-mutator/core and @stryker-mutator/mocha-runner as development dependencies.

Ran npx stryker init to create the configuration file.

Added stryker.config.mjs file.

Updated .gitignore with recommended Stryker patterns.

Added "mutate" script to package.json:

"scripts": {
"mutate": "stryker run"
}

Testing:

Stryker runs successfully with npm run mutate.

146 tests passed.

10 tests failed — this is expected and helps identify areas where test coverage or assertions could be improved.

Let me know if anything needs to be changed or improved. Thanks!

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@dariomannu
Copy link
Contributor

Hi @dantesb777 did you actually run and test this?

https://stackblitz.com/~/github.com/ReactiveHTML/rimmel/pull/57?view=editor

it fails with this error:

$ npm run mutate

> [email protected] mutate
> stryker run

file:///home/ReactiveHTML/rimmel/node_modules/@stryker-mutator/core/dist/src/stryker-cli.js:7
import { defaultOptions } from './config/index.js';
         ^^^^^^^^^^^^^^

file:///home/ReactiveHTML/rimmel/node_modules/@stryker-mutator/core/dist/src/stryker-cli.js:7
import { defaultOptions } from './config/index.js';
         ^^^^^^^^^^^^^^
SyntaxError: The requested module './config/index.js' does not provide an export named 'defaultOptions'
    at _instantiate (node:internal/modules/esm/module_job:158:2290) {
  [Symbol(node:decorated)]: true
}

@dantesb777
Copy link
Author

dantesb777 commented Oct 9, 2025

Hi @dariomannu, thanks for the follow-up!

Yes, I ran npm run mutate as requested, and Stryker executed successfully this time. However, the initial test run reported 10 failing tests even before any mutation was applied.

Let me know if you'd like me to look into these failing tests, or if they're already known issues.

Thanks again!

@dariomannu
Copy link
Contributor

the failing tests come from a recent PR that shouldn't have been merged yet. If you're able to fix them and you'd be so kind, it would be wonderful, otherwise we'll raise another PR to fix them. huge thanks!

@dantesb777
Copy link
Author

Thanks for clarifying, @dariomannu! 😊
I’d be happy to look into fixing those failing tests.
I’ll check which ones are failing and push a fix as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants