Using Rewire for testing..
Rewire is failing to rewire, and I'm wondering why.
Here is an example of rewire failing:
A file has a few exported functions...
export function foo() {}
export function bar() {}
export function baz() {}
In a test file...
import * as pathFileHelpers from 'path/to/file';
pathFileHelpers.__Rewire__({
readFileSync: () => {
return 'test test test'
},
})
_get__(...).__Rewire__ is not a function
Why?
asked Dec 10, 2020 at 18:02
GN.
10.1k16 gold badges75 silver badges143 bronze badges
lang-js