jest-ts-auto-mock icon indicating copy to clipboard operation
jest-ts-auto-mock copied to clipboard

FEATURE REQUEST | Support for @swc/jest

Open justLuiz opened this issue 3 years ago • 6 comments

Hello guys.

first, thanks for this wonderful tool.

are you planning to add support for @swc/jest?

https://swc.rs/docs/usage/jest

https://github.com/swc-project/jest

justLuiz avatar Jan 13 '22 22:01 justLuiz

Hi @justLuiz ! Sorry for the late reply! I will have a look! I am a bit busy with family!

uittorio avatar Jan 15 '22 13:01 uittorio

Hey! So swc is a rust based compiler. Our plugin act on the compiler that it is in Javascript. In order to have the same kind of feature you could check what babel can do because I read that swc supports babel plugins. If you want to just use typescript and non babel unfortunately it will not work.

uittorio avatar Jan 15 '22 15:01 uittorio

hey @uittorio thanks for reply...

yes, swc supports plugins, I don't know if the use of plugins is the same as in babel, anyway.

https://github.com/Typescript-TDD/ts-auto-mock is the best place for this discussion?

justLuiz avatar Jan 17 '22 17:01 justLuiz

Myself and @Pmyl are the best people to ask questions. Ts auto mock is a better place but I am afraid you may not get a better answer. The problem is that swc does not use the typescript compiler or ast. Ts auto mock needs typescript itself not just the syntax language. I have the feeling that we may have to create a plugin specifically for swc. Feel free to start something, I am more than happy to contribute, I just dont have the time

uittorio avatar Jan 17 '22 17:01 uittorio

no problem, i'll dig deep to understand better, and try to start something. thanks again.

justLuiz avatar Jan 17 '22 17:01 justLuiz

I would be happy to practice some Rust :) as long as the data available during compilation is comparable I'm sure it can be done

Pmyl avatar Jan 17 '22 18:01 Pmyl