Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements jest.requireMock
Similar to #4260
Test plan
Added jest_require_mock.test.js, and added to extract_requires.test.js for testing. Ran yarn test, partial output below
`jeffreylai-mbp:jest jeffreylai$ yarn test
Using globally installed version of Yarn
yarn test v0.28.1
$ yarn run typecheck --silent && yarn run lint --silent && yarn run jest --silent && yarn run test-examples --silent
Using globally installed version of Yarn
Found 0 errors
Using globally installed version of Yarn
Using globally installed version of Yarn
...
...
Test Suites: 162 passed, 162 total
Tests: 1502 passed, 1502 total
Snapshots: 671 passed, 671 total
Time: 100.887s
Ran all test suites.
Using globally installed version of Yarn
$ cd /Users/jeffreylai/Documents/jest/examples/react-native
$ yarn --production
Using globally installed version of Yarn
warning package.json: No license field
warning [email protected]: No license field
$ cd /Users/jeffreylai/Documents/jest/scripts
$ /Users/jeffreylai/Documents/jest/packages/jest-cli/bin/jest.js --projects /Users/jeffreylai/Documents/jest/examples/async /Users/jeffreylai/Documents/jest/examples/enzyme /Users/jeffreylai/Documents/jest/examples/getting_started /Users/jeffreylai/Documents/jest/examples/jquery /Users/jeffreylai/Documents/jest/examples/manual_mocks/package.json /Users/jeffreylai/Documents/jest/examples/module_mock/package.json /Users/jeffreylai/Documents/jest/examples/react/package.json /Users/jeffreylai/Documents/jest/examples/react-native/package.json /Users/jeffreylai/Documents/jest/examples/snapshot/package.json /Users/jeffreylai/Documents/jest/examples/timer/package.json /Users/jeffreylai/Documents/jest/examples/typescript/package.json
...
...
Test Suites: 19 passed, 19 total
Tests: 39 passed, 39 total
Snapshots: 12 passed, 12 total
Time: 3.358s, estimated 6s
Ran all test suites in 11 projects.
✨ Done in 123.80s.`