test(target): add config case coverage for electron-main and electron-preload#20630
Conversation
|
Merging this PR will degrade performance by 25.82%
Performance Changes
Comparing |
|
This PR is packaged and the instant preview is available (d5fc9c6). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@d5fc9c6
yarn add -D webpack@https://pkg.pr.new/webpack@d5fc9c6
pnpm add -D webpack@https://pkg.pr.new/webpack@d5fc9c6 |
Summary
This PR adds config case coverage for the missing Electron target contexts:
electron-mainelectron-preloadwebpack already has a config case for
electron-rendererundertest/configCases/target/electron-renderer, but there was no dedicated config case coverage for the other two supported Electron target contexts.The new test cases use a small local fixture package with both
mainandbrowserfields and assert that:electron-rendererprefers thebrowserfield (existing behavior)electron-mainprefers themainfieldelectron-preloadprefers themainfieldThis helps verify the target-specific resolution behavior and improves regression coverage around Electron target handling.
Fixes: #20629
What kind of change does this PR introduce?
test
Did you add tests for your changes?
Yes
Added two new config case test folders:
test/configCases/target/electron-maintest/configCases/target/electron-preloadI also ran targeted local verification for these config cases. The new electron cases compiled successfully.
Does this PR introduce a breaking change?
No.
This only adds test coverage.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
No additional documentation is needed because this PR only adds tests.
Use of AI
I used AI for planning and drafting some text. I reviewed the repo structure, issue scope, test setup, and final code changes manually before preparing this PR.