Skip to content

test: fix main's Rsbuild hook-context and webpack project-root tests broken by concurrent merges - #991

Open
owjs3901 wants to merge 3 commits into
mainfrom
fix/rsbuild-hook-test-missing-dependency
Open

owjs3901 wants to merge 3 commits into
mainfrom
fix/rsbuild-hook-test-missing-dependency

Conversation

@owjs3901

@owjs3901 owjs3901 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Main's bun test still fails two Rsbuild tests after #990, so every PR that merges main goes red on publish.

Test plan

  • bun test packages/rsbuild-plugin/src/__tests__/hooks.test.ts on main: 2 fail before, 5 pass after
  • bun test packages/webpack-plugin/src/__tests__/plugin.test.ts on current main: the project-root test fails before, the file passes after (3532 pass with the hooks test)
  • CI

요약

#990 이후에도 main의 bun test에서 Rsbuild 테스트 두 개가 실패합니다. 그래서 main을 병합한 PR은 모두 publish가 빨갛게 됩니다.

  • #928은 Rsbuild source transform이 확장한 devup.json 설정을 addMissingDependency로 등록하게 합니다.
  • #957의 hooks.test.ts는 가짜 transform context를 addDependency만으로 만듭니다.
  • 두 PR이 모두 병합되면서 CSS revisions > serves and writes the rule of a same-length edit와 builds once more only in the environment whose served sheet went stale가 TypeError: addMissingDependency is not a function을 던집니다.
  • 이 PR은 테스트의 TransformContext와 모든 가짜 context에 addMissingDependency를 추가합니다. 플러그인 코드는 바꾸지 않습니다.
  • fix(plugins): resolve relative options against the bundler project root #962 병합 후 찾은 두 번째 문제: webpack-plugin의 project root > resolves the relative options against webpack's context(fix(plugins): resolve relative options against the bundler project root #962)는 loadDevupConfigSync가 devup.json 경로만 받는다고 기대하지만, fix(plugins): watch the configs devup.json extends in webpack and Rsbuild #928 이후로는 확장 설정을 모으는 Set도 함께 받습니다. 같은 파일의 다른 loadDevupConfigSync 검사처럼 두 번째 인자로 expect.any(Set)을 기대하도록 고쳤습니다.

테스트 계획

  • main에서 bun test packages/rsbuild-plugin/src/__tests__/hooks.test.ts: 수정 전 2개 실패, 수정 후 5개 통과
  • 현재 main에서 bun test packages/webpack-plugin/src/__tests__/plugin.test.ts: 수정 전 project-root 테스트 실패, 수정 후 통과(hooks 테스트와 함께 3532개 통과)
  • CI

🤖 Generated with Claude Code

owjs3901 and others added 3 commits November 17, 2026 16:26
#928 makes the source transform register missing devup.json configs through
addMissingDependency, while #957's hook test builds its transform contexts
with addDependency only. Both merged, so two CSS revision tests throw
"addMissingDependency is not a function" on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t test

#962 asserts loadDevupConfigSync is called with only the resolved devup.json,
but since #928 the plugin also passes the set it collects extended configs
into. Both merged, so the assertion fails on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@owjs3901 owjs3901 changed the title test(rsbuild-plugin): give the hook test contexts addMissingDependency test: fix main's Rsbuild hook-context and webpack project-root tests broken by concurrent merges Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant