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
[TS] empty import type declaration makes initial test run fail #3386
Comments
A small correction import type { } from 'some-module'; Gets instrumented to: import type 'some-module'; Which indeed cannot be compiled with Will have to investigate further. |
It seems that both code examples have the exact same AST. So I'm not sure if there is anything we can do about it. @m-ronchi what exactly is your use case for |
it contains an external module augmentation, plus other code that is injected at an upper layer. I need to import the type declarations when I just include the code (for unit tests, external module is mocked). more specifically, it is a fastify plugin with import fp from "fastify-plugin";
declare module "fastify" {
interface FastifyInstance { // add myPlugin to external type declaration
myPlugin: Foo;
}
}
export const plugin = fp(function (fastify) {
fastify.decorate("myPlugin", foo); // add myPlugin to runtime instance
});
|
I see. No easy solution I'm afraid. I've opened babel/babel#14250 |
Some traction there, hopefully a fix soon |
supposedly fixed in https://github.com/babel/babel/releases/tag/v7.17.7 babel/babel#14309 |
looks like it's fixed |
Summary
if a file contains an import in the form
then stryker generates an invalid import statement in the mutated ts file:
which fails to compile with the error
Stryker config
Test runner config
mocharc.json
Stryker environment
Test runner environment
Your Environment
Add stryker.log
stryker.log
code-mutated.zip
code-original.zip
The text was updated successfully, but these errors were encountered: