speedskater / babel-plugin-rewire

A babel plugin adding the ability to rewire module dependencies. This enables to mock modules for testing purposes.
843 stars 90 forks source link

Integration with CRACO #240

Open SnapeEye opened 1 year ago

SnapeEye commented 1 year ago

Hey!

Faced a problem when tried to add this plugin in CRACO project. Jest test runner is used. What I did:

So when I run tests, I expect the following code to be valid:

import { __RewireAPI__ as RWA } from '../logic'
import { __Rewire__ as RW } from '../logic'
console.log(RWA)
console.log(RW)

Tried different naming, thought maybe smth changed. But got undefined for both.

Maybe someone will advice what can be done? Or explain why it is not working. Or where I messed up -_- Will appreciate any help, comments, explanations, etc.

SnapeEye commented 1 year ago

ping

SnapeEye commented 1 year ago

ping

SnapeEye commented 1 year ago

ping