You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some time now, @stryker-mutator/api is a direct dependency for core as well es all other plugins. The idea is that, since the api doesn't have direct side effects, it is OK to depend on it and it would be OK if the version used by a plugin is different from the core.
However, this can break serialization/deserialization. The transpiler new's it's own File instances (for example, here). The File constructor class used by the plugin is unrelated to the one used in core. This makes it so it is NOT serialized as an instance of File by surrial. Later, when stryker tries to compare file content using the textContent property it never notices the changes, since it will be comparing undefined === undefined.
Workaround
The (only) workaround is to make sure that @stryker-mutator/api is hoisted to the top level of your node_modules. This should be the case when your stryker version is in sync.
node_modules/
└── @stryker-mutator/
├── core
├── typescript
└── api
The text was updated successfully, but these errors were encountered:
Customize the way we serialize files to make sure different versions of `stryker-api` can be mixed and matched (although not recommended).
Fixes#2025
Co-authored-by: Simon de Lang <simondelang@gmail.com>
Summary
Given the following directory structure:
When running
stryker run
here, the coverage analysisperTest
is broken.Stryker config
Details
For some time now,
@stryker-mutator/api
is a direct dependency forcore
as well es all other plugins. The idea is that, since the api doesn't have direct side effects, it is OK to depend on it and it would be OK if the version used by a plugin is different from the core.The api does have some class implementations, in particular File.ts. Instances of this class are serialized and deserialized using surrial.
However, this can break serialization/deserialization. The transpiler
new
's it's ownFile
instances (for example, here). TheFile
constructor class used by the plugin is unrelated to the one used in core. This makes it so it is NOT serialized as an instance ofFile
by surrial. Later, when stryker tries to compare file content using thetextContent
property it never notices the changes, since it will be comparingundefined === undefined
.Workaround
The (only) workaround is to make sure that
@stryker-mutator/api
is hoisted to the top level of yournode_modules
. This should be the case when your stryker version is in sync.The text was updated successfully, but these errors were encountered: