test: update target flag tests for webpack 5.108 - #4797
#4797test: update target flag tests for webpack 5.108#4797alexander-akait merged 1 commit intomainwebpack/webpack-cli:mainfrom claude/resolve-failed-tests-a3ugghwebpack/webpack-cli:claude/resolve-failed-tests-a3ugghCopy head branch name to clipboard
Conversation
webpack 5.108 introduces the universal, deno and bun targets and supports combining targets like node and web via universal ESM output, which broke the target flag tests: - update the "Unknown target" stderr snapshots to include the new universal, deno and bun entries - replace the "should throw an error for incompatible multiple targets" test with "should allow multiple different targets", since node + web now builds successfully - bump webpack to 5.108.3 in the lockfile so the snapshots match the installed version Fixes the failing CI on #4792 and unblocks #4795. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iKSSr35Ue6UtyA6rcw6UA
|
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4797 +/- ##
=======================================
Coverage 93.43% 93.43%
=======================================
Files 14 14
Lines 5420 5420
Branches 788 788
=======================================
Hits 5064 5064
Misses 354 354
Partials 2 2 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates the --target flag test suite to match webpack 5.108’s updated target behavior and refreshes related snapshots/lockfile state so CI can pass against the newer webpack.
Changes:
- Adjust
--targettests to treatnode+webas a valid multi-target combination (exit code 0). - Regenerate “Unknown target” stderr snapshots to include newly supported targets (
universal,deno,bun). - Update the lockfile to resolve to webpack
5.108.3and reflect related transitive dependency changes.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/build/target/flag-test/target-flag.test.js | Updates multi-target test expectations to reflect webpack 5.108 behavior. |
| test/build/target/flag-test/snapshots/target-flag.test.js.snap.webpack5 | Refreshes snapshots for updated “Unknown target” output and removes now-obsolete error snapshot. |
| package-lock.json | Locks to webpack 5.108.3 and updates related dependency graph entries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
CI on #4792 fails (and #4795 is blocked) because webpack 5.108 changed target behavior in two ways that broke
test/build/target/flag-test/target-flag.test.js:universal,denoandbuntargets, so the "Unknown target 'invalid'" stderr snapshots no longer match.node+webno longer fails with "no default script chunk format available" — webpack now builds them successfully with universal ESM output, so the "should throw an error for incompatible multiple targets" test gets exit code 0 instead of 2.Changes
package-lock.json(already allowed by the^5.107.2range; snapshots are keyed per webpack major and must match the locked version).universal,denoandbuntarget descriptions.node+webnow builds successfully.Testing
Full jest suite passes locally with webpack 5.108.3 (727 passed, 330/330 snapshots).
Once merged, Dependabot can rebase #4792 and #4795 and their CI should go green.
🤖 Generated with Claude Code
https://claude.ai/code/session_012iKSSr35Ue6UtyA6rcw6UA
Generated by Claude Code