rollup-jest icon indicating copy to clipboard operation
rollup-jest copied to clipboard

Doesn't hoist `jest.mock` and similar

Open cpiber opened this issue 2 years ago • 0 comments

All jest docs implicitly rely on the fact that the default configuration hoists jest.mock when mocking modules. rollup-jest does not do this.

I think there either needs to be a big warning in the README or, better yet, a plugin to hoist those calls.

References: https://github.com/facebook/jest/issues/2582#issuecomment-378677440, https://github.com/facebook/jest/blob/main/packages/babel-plugin-jest-hoist/README.md, https://github.com/kulshekhar/ts-jest/blob/main/src/transformers/hoist-jest.ts

cpiber avatar Sep 15 '21 11:09 cpiber