Skip to content

Comments

fix(rstest): replace mockRequire to rstest_mock_require#13056

Merged
9aoy merged 1 commit intomainfrom
rstest_mock_require
Feb 13, 2026
Merged

fix(rstest): replace mockRequire to rstest_mock_require#13056
9aoy merged 1 commit intomainfrom
rstest_mock_require

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Feb 13, 2026

Summary

replace mockRequire to rstest_mock_require.

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@9aoy 9aoy requested a review from LingyuCoder as a code owner February 13, 2026 08:36
Copilot AI review requested due to automatic review settings February 13, 2026 08:36
@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Feb 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mockRequire to MockMethod::MockRequire (instead of MockMethod::Mock) in the parser plugin.
  • Add __webpack_require__.rstest_mock_require as an alias to __webpack_require__.rstest_mock in 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.

@github-actions
Copy link
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 825.4 KB 0
react-5k 2.7 MB 0
rome 984.2 KB 0
ui-components 2.2 MB 0

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing ab622ec to feat(progress-plugin)!: replace handler rest args with structured info object (#13049) by neverland

🙈 Size remains the same at 48.68MB

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 13, 2026

Merging this PR will not alter performance

✅ 17 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing rstest_mock_require (ab622ec) with main (6d6c47a)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@9aoy 9aoy requested a review from fi3ework February 13, 2026 09:00
@9aoy 9aoy enabled auto-merge (squash) February 13, 2026 09:21
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

📝 Ecosystem CI detail: Open

suite result
rstest ✅ success

@9aoy 9aoy merged commit e34c8b9 into main Feb 13, 2026
58 checks passed
@9aoy 9aoy deleted the rstest_mock_require branch February 13, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants