fix(rstest): replace mockRequire to rstest_mock_require#13056
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the rspack_plugin_rstest transform so rs.mockRequire(...) emits the dedicated runtime hook __webpack_require__.rstest_mock_require, and adjusts the rstest mock runtime used in config-case tests to provide that hook.
Changes:
- Map
rs.mockRequiretoMockMethod::MockRequire(instead ofMockMethod::Mock) in the parser plugin. - Add
__webpack_require__.rstest_mock_requireas an alias to__webpack_require__.rstest_mockin the rstest mock config-case runtime.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/rspack-test/configCases/rstest/mock/rspack.config.js | Adds the rstest_mock_require runtime method (as an alias) so transformed output can call it. |
| crates/rspack_plugin_rstest/src/parser_plugin.rs | Fixes rs.mockRequire to generate the correct mock-method dependency (MockRequire). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🙈 Size remains the same at 48.68MB |
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
replace
mockRequiretorstest_mock_require.Related links
Checklist