Closed kentcdodds closed 4 years ago
Just dropping a quick note so I don't forget. I'm pretty sure that we can replace this:
https://github.com/kentcdodds/babel-plugin-macros/blob/2d57c60adadd8904db9624614faffc34a251c40d/src/__tests__/index.js#L36-L44
With virtual mocks as documented here: https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options
jest.mock( '../moduleName', () => { /* * Custom implementation of a module that doesn't exist in JS, * like a generated module or a native module in react-native. */ }, {virtual: true}, );
I tried this and it didn't work 🤷♂️
Just dropping a quick note so I don't forget. I'm pretty sure that we can replace this:
https://github.com/kentcdodds/babel-plugin-macros/blob/2d57c60adadd8904db9624614faffc34a251c40d/src/__tests__/index.js#L36-L44
With virtual mocks as documented here: https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options