-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] Mutating the source fails the tests but still Stryker shows no kills #3068
Comments
Could this be related to #3012(comment) ? How do you know "the mutants aren't killed"? Also, the docs link about a possible problem where all mutants survive and known workarounds: https://stryker-mutator.io/docs/stryker-js/troubleshooting#all-mutants-survive---jest-runner Have you tried that? |
@Edgpaez If you see my "stryker config", I have given |
@sincerekamal Are you using native ECMA script modules by any chance? If so, then that's the issue. You will need to run with If that isn't the issue, could you please create a small reproduction repository (or point us to the source code if your project is open source)? The jasmine runner should work as expected, as per our jasmine example in our e2e tests: https://github.com/stryker-mutator/stryker-js/tree/master/e2e/test/jasmine-javascript |
@sincerekamal do you think you could find some time to test my hypothesis and report back here? 😇 |
Sure @nicojs , I will try it and update here. |
@nicojs I tried it, it's still not working. You can try it here, https://github.com/sincerekamal/stryker-test |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@nicojs did you get chance to look at that ? |
Hi, @sincerekamal, thanks for pinging me. I forgot all about this issue, sorry 😢. I found what the culprit is: you're using // register modules that are aliased (see package.json)
require("module-alias/register"); This registeres the module aliases from your package.json: {
"_moduleAliases": {
"@config": "./src/config",
"@middlewares": "./src/middlewares",
"@models": "./src/models",
// ...
}
} This allows you to do magic imports like these: const { TokenError } = require("@errors");
const { Meals } = require("@models");
const { getCalories } = require("@services/nutrition"); But it doesn't play nice with StrykerJS's sandboxing, as alias imports like this always import from your local project instead of the sandbox as Stryker is counting on. This line is the culprit: https://github.com/ilearnio/module-alias/blob/dev/index.js#L166 I would advice you to move away from
If you want to keep using
Result for both workarounds:
|
Thanks a lot @nicojs , let me try it and will update you. Thanks for spending your time on this !! |
I think this should be documented in our troubleshooting guide, so re-opening :). |
Summary
I have recently configured stryker as per the "Getting started". When I tried
stryker run
there are no mutants which were killed. So, I doubted myself and tried mutating(changing) as per the mutation statements shown in console. Now, I triednpm test
and the tests were failed. So, why the mutants aren't killed even when the tests are failing ? Is there any config issue ? or is it due to thejasmine
orWindows OS
?Stryker config
Test runner config
Stryker environment
Test runner environment
# Test command jasmine --config=./test/jasmine-unit.json
Your Environment
Add stryker.log
stryker.log
The text was updated successfully, but these errors were encountered: