GeezerVison is showing github.com — test: group the syntax unit tests by language, merge the JavaScript ones by alexander-akait · Pull Request #22824 · webpack/webpack
Conversation
alexander-akait
commented
Oct 20, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
The syntax unit tests were spread across the top level of test/unitCases/. The JavaScript ones were also split into 14 files as features landed, and four of those test the same parser. This change moves them into one folder per language and merges the JavaScript files into one file per component.
| Folder |
Files |
javascript/ |
parser ← WebpackParser, RegExpValidator, Parser, JavascriptSyntaxTree
webpack-parser ← JavascriptParser
scope ← ScopeAnalyzer, ScopeAnalyzerParity
printer ← syntax-printer, -tree, -estree, -name-cache
minify ← jsMinify
no-acorn ← ParserWithoutAcorn |
css/ |
syntax ← CssSyntax |
html/ |
syntax ← HtmlSyntax
entry-wrapper ← HtmlEntryWrapper |
xml/ |
minify ← xmlMinify |
json/ |
minify ← jsonMinify
web-manifest ← WebManifestParser |
tooling/ |
css-data ← CssValueSyntax
compare-js, compare-css, compare-html, compare-xml ← Compare*Tools*
compare-harness, compare-path-span-walk, compare-purity, compare-slices, compare-spans ← CompareTools* |
Some files keep their own file:
no-acorn replaces acorn with a throwing mock for the whole file, so it can't share a file with tests that use acorn.
entry-wrapper must be the first build in its process.
How the merges were done:
- Every
describe, test and assertion is kept as written.
- Where two files required the same value, the merged file keeps one binding. For example, the scope-parity tests now use
parseProgram, the name the analyzer tests import it under.
- Bindings with different values get distinct names:
PortOptions and TREE_OPTION_SETS. The Parser tests keep their typed view of acorn as acornPort.
- Snapshot files moved with their tests. The two printer snapshot files are merged into one.
Also updated:
- the
test:unit, cover:unit, test:deno and test:bun match patterns, jest.config.js and tsconfig.types.test.json, now unitCases/**/*.unittest.js
- the cspell ignore path
- the docs and comments that named the old files
What kind of change does this PR introduce?
test (a refactor of the test layout)
Did you add tests for your changes?
No new tests. I compared the full name of every test on both sides: the 29 old files on main against the new folders on this branch.
- Test names: identical. The only difference is 46
cssIdentifier tests, which ran only on the branch side because the test/unitCases/css path filter also matched the root cssIdentifier.unittest.js.
- Snapshots: 723 on both sides.
- Failures: none on the branch. One existing test-order failure on
main (builtinEmbeddedRenderer, in the unchanged HTML file) didn't occur on the branch.
- Whole unit suite: 149 files. All pass except
ProfilingPlugin, which needs a Chrome the local machine doesn't have.
yarn lint and lint:types-test are clean.
Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
TESTING_DOCS.md describes the new layout.
Use of AI
Claude Code proposed the layout. It merged the files with a scope-aware script and checked the test names against main. I reviewed it.
Generated by Claude Code
Summary by CodeRabbit
-
Tests
- Reorganized unit tests into language- and tooling-specific directories.
- Test runners and coverage commands now discover nested unit tests automatically.
- Expanded parser, printer, scope analysis, and syntax-tree coverage.
- Removed several superseded test suites while consolidating coverage into active suites.
-
Documentation
- Updated testing, parser comparison, and syntax references to match the reorganized test structure.
-
Chores
- Corrected test imports, fixtures, type references, and spell-check paths after relocation.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The syntax unit tests move into one folder per language — javascript/,
css/, html/, xml/, json/ — and the tests of the tooling/ scripts into
tooling/. The fourteen JavaScript files become six, one per component:
- parser: WebpackParser, RegExpValidator, Parser, JavascriptSyntaxTree
- webpack-parser: JavascriptParser
- scope: ScopeAnalyzer, ScopeAnalyzerParity
- printer: syntax-printer and its -tree, -estree and -name-cache files
- minify: jsMinify
- no-acorn: ParserWithoutAcorn, alone for its jest.mock of acorn
No test changes: the merged files keep every describe and assertion, and
reuse one binding where two files required the same value.
Claude-Session: https://claude.ai/code/session_017TkBWTk3wcyUcJYDp5ZhaP
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
This PR is packaged and the instant preview of its latest commit is available.
Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@22824
yarn add -D webpack@https://pkg.pr.new/webpack@22824
pnpm add -D webpack@https://pkg.pr.new/webpack@22824
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Types CoverageCoverage after merging refactor/unit-tests-by-language into main will be
Coverage Report| File | Stmts | Branches | Funcs | Lines | Uncovered Lines |
|---|
| bin | | webpack.js | 98.86% | 100% | 100% | 98.86% | 113 | | declarations | | WebpackOptions.ts | 99.94% | 100% | 100% | 99.94% | 4240 | | examples | | build-common.js | 100% | 100% | 100% | 100% | | | buildAll.js | 100% | 100% | 100% | 100% | | | examples.js | 100% | 100% | 100% | 100% | | | template-common.js | 98.21% | 100% | 100% | 98.21% | 72 | | examples/custom-javascript-parser | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/custom-javascript-parser/internals | | acorn-parse.js | 100% | 100% | 100% | 100% | | | meriyah-parse.js | 100% | 100% | 100% | 100% | | | oxc-parse.js | 100% | 100% | 100% | 100% | | | examples/markdown | | webpack.config.mjs | 100% | 100% | 100% | 100% | | | examples/module-federation | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/reexport-components | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/ssr | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/typescript | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/typescript-non-erasable | | test.filter.js | 50% | 100% | 100% | 50% | 5 | | examples/virtual-modules | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/wasm-bindgen-esm | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/wasm-complex | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/wasm-emscripten | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/wasm-simple | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/wasm-simple-source-phase | | test.filter.js | 100% | 100% | 100% | 100% | | | lib | | Chunk.js | 100% | 100% | 100% | 100% | | | Compilation.js | 98.71% | 100% | 100% | 98.71% | 1783, 2096, 2103, 2111, 2133, 2136, 3124, 3683, 3726, 4315, 4319, 4446, 4467, 4592, 4629, 4636, 4689–4690, 4694, 4699, 4715–4716, 4730–4731, 4736–4737, 5265, 5291, 6141, 6158, 6176, 6192, 6207, 6232, 6235, 6603, 6606–6607, 6612, 6627, 6710, 6734, 855–856 | | Compiler.js | 98.81% | 100% | 100% | 98.81% | 1116, 1153, 1156, 1336–1337, 1345, 848, 934, 975 | | Dependency.js | 100% | 100% | 100% | 100% | | | DependencyTemplate.js | 100% | 100% | 100% | 100% | | | EntryPlugin.js | 100% | 100% | 100% | 100% | | | Entrypoint.js | 100% | 100% | 100% | 100% | | | ExternalsPlugin.js | 100% | 100% | 100% | 100% | | | FileSystemInfo.js | 100% | 100% | 100% | 100% | | | InitFragment.js | 100% | 100% | 100% | 100% | | | LibraryTemplatePlugin.js | 100% | 100% | 100% | 100% | | | ModuleFilenameHelpers.js | 100% | 100% | 100% | 100% | | | ModuleNotFoundError.js | 100% | 100% | 100% | 100% | | | MultiCompiler.js | 98.91% | 100% | 100% | 98.91% | 489, 561, 748, 813 | | NormalModule.js | 100% | 100% | 100% | 100% | | | NullFactory.js | 100% | 100% | 100% | 100% | | | ProgressPlugin.js | 100% | 100% | 100% | 100% | | | RawModule.js | 100% | 100% | 100% | 100% | | | RequestShortener.js | 100% | 100% | 100% | 100% | | | SingleEntryPlugin.js | 100% | 100% | 100% | 100% | | | WebpackError.js | 100% | 100% | 100% | 100% | | | index.js | 100% | 100% | 100% | 100% | | | webpack.js | 98.59% | 100% | 100% | 98.59% | 306, 308 | | lib/asset | | AssetBytesGenerator.js | 100% | 100% | 100% | 100% | | | AssetBytesParser.js | 91.67% | 100% | 100% | 91.67% | 27 | | AssetGenerator.js | 100% | 100% | 100% | 100% | | | AssetModule.js | 100% | 100% | 100% | 100% | | | AssetModulesPlugin.js | 98.45% | 100% | 100% | 98.45% | 334, 360, 363, 493, 58 | | AssetParser.js | 96.15% | 100% | 100% | 96.15% | 47 | | AssetSourceGenerator.js | 100% | 100% | 100% | 100% | | | AssetSourceParser.js | 91.67% | 100% | 100% | 91.67% | 27 | | RawDataUrlModule.js | 100% | 100% | 100% | 100% | | | WebManifestGenerator.js | 100% | 100% | 100% | 100% | | | WebManifestParser.js | 100% | 100% | 100% | 100% | | | lib/async-modules | | AsyncModuleHelpers.js | 100% | 100% | 100% | 100% | | | AwaitDependenciesInitFragment.js | 100% | 100% | 100% | 100% | | | InferAsyncModulesPlugin.js | 100% | 100% | 100% | 100% | | | isGeneratorLowered.js | 100% | 100% | 100% | 100% | | | lib/bun | | BunTargetPlugin.js | 100% | 100% | 100% | 100% | | | lib/cache | | AddBuildDependenciesPlugin.js | 100% | 100% | 100% | 100% | | | AddManagedPathsPlugin.js | 100% | 100% | 100% | 100% | | | Cache.js | 98.25% | 100% | 100% | 98.25% | 104 | | CacheFacade.js | 100% | 100% | 100% | 100% | | | IdleFileCachePlugin.js | 97.92% | 100% | 100% | 97.92% | 75, 87, 95 | | MemoryCachePlugin.js | 92% | 100% | 100% | 92% | 33, 42 | | MemoryWithGcCachePlugin.js | 93.42% | 100% | 100% | 93.42% | 106, 120–121, 130, 88 | | PackFileCacheStrategy.js | 96.54% | 100% | 100% | 96.54% | 1306, 1406, 1410, 1472, 1718, 1802, 1825, 1855, 684, 703, 713–715, 717, 733–734, 739, 742, 744, 749, 754, 779, 785, 819, 825, 831, 836, 847, 856, 861–862, 864, 881, 887–888, 890 | | ResolverCachePlugin.js | 100% | 100% | 100% | 100% | | | getLazyHashedEtag.js | 100% | 100% | 100% | 100% | | | mergeEtags.js | 100% | 100% | 100% | 100% | | | lib/config | | OptionsApply.js | 100% | 100% | 100% | 100% | | | PlatformPlugin.js | 100% | 100% | 100% | 100% | | | WebpackOptionsApply.js | 100% | 100% | 100% | 100% | | | WebpackOptionsDefaulter.js | 100% | 100% | 100% | 100% | | | browserslistTargetHandler.js | 100% | 100% | 100% | 100% | | | cli.js | 98.89% | 100% | 100% | 98.89% | 114, 550, 582, 632 | | defaults.js | 99.59% | 100% | 100% | 99.59% | 1633–1635, 1643, 288, 548 | | defineConfig.js | 100% | 100% | 100% | 100% | | | getClaimedAssetTypes.js | 100% | 100% | 100% | 100% | | | normalization.js | 99.14% | 100% | 100% | 99.14% | 285–286, 356, 371 | | target.js | 100% | 100% | 100% | 100% | | | validateSchema.js | 94.67% | 100% | 100% | 94.67% | 100, 87, 89, 98 | | lib/container | | ContainerEntryDependency.js | 100% | 100% | 100% | 100% | | | ContainerEntryModule.js | 100% | 100% | 100% | 100% | | | ContainerEntryModuleFactory.js | 100% | 100% | 100% | 100% | | | ContainerExposedDependency.js | 100% | 100% | 100% | 100% | | | ContainerPlugin.js | 100% | 100% | 100% | 100% | | | ContainerReferencePlugin.js | 100% | 100% | 100% | 100% | | | FallbackDependency.js | 100% | 100% | 100% | 100% | | | FallbackItemDependency.js | 100% | 100% | 100% | 100% | | | FallbackModule.js | 100% | 100% | 100% | 100% | | | FallbackModuleFactory.js | 100% | 100% | 100% | 100% | | | HoistContainerReferencesPlugin.js | 100% | 100% | 100% | 100% | | | ModuleFederationPlugin.js | 100% | 100% | 100% | 100% | | | RemoteModule.js | 100% | 100% | 100% | 100% | | | RemoteRuntimeModule.js | 100% | 100% | 100% | 100% | | | RemoteToExternalDependency.js | 100% | 100% | 100% | 100% | | | declaredRemotes.js | 100% | 100% | 100% | 100% | | | moduleFederationHooks.js | 100% | 100% | 100% | 100% | | | options.js | 100% | 100% | 100% | 100% | | | lib/context | | ContextExclusionPlugin.js | 100% | 100% | 100% | 100% | | | ContextModule.js | 99.88% | 100% | 100% | 99.88% | 1495 | | ContextModuleFactory.js | 95.70% | 100% | 100% | 95.70% | 230, 257, 276, 280–281, 289, 466, 487, 492, 534, 543, 545, 549, 552, 558–559 | | ContextReplacementPlugin.js | 100% | 100% | 100% | 100% | | | lib/css | | CssGenerator.js | 99.29% | 100% | 100% | 99.29% | 1094, 129, 305, 847 | | CssInjectStyleRuntimeModule.js | 100% | 100% | 100% | 100% | | | CssLoadingRuntimeModule.js | 100% | 100% | 100% | 100% | | | CssModule.js | 100% | 100% | 100% | 100% | | | CssModulesPlugin.js | 98.72% | 100% | 100% | 98.72% | 217, 418, 432, 445, 458, 481, 494, 507, 520 | | CssParser.js | 99.76% | 100% | 100% | 99.76% | 1090, 2425, 3072, 3075, 3081, 3514, 943 | | CssServerStylesRuntimeModule.js | 100% | 100% | 100% | 100% | | | conventions.js | 100% | 100% | 100% | 100% | | | cssMinify.js | 100% | 100% | 100% | 100% | | | data.js | 99.84% | 100% | 100% | 99.84% | 229, 5605 | | syntax-parser.js | 99.69% | 100% | 100% | 99.69% | 11139–11140, 11692–11693, 11730, 11940, 11989, 14346, 14407–14410, 14515–14516, 14614–14615, 15373, 15670, 15672, 16203, 16595, 16637, 18880, 2621, 3328, 3330, 3335, 3354, 4103, 4109 | | syntax-printer.js | 99.33% | 100% | 100% | 99.33% | 2614–2615, 2617–2618, 2620–2621, 2626, 2896–2899, 2992, 356, 3693, 4118, 4254, 4972, 5283, 6088, 730 | | syntax.js | 100% | 100% | 100% | 100% | | | topologicalSort.js | 100% | 100% | 100% | 100% | | | lib/debug | | ProfilingPlugin.js | 100% | 100% | 100% | 100% | | | lib/define | | DefinePlugin.js | 99.42% | 100% | 100% | 99.42% | 1488, 936, 938, 943, 967 | | DotenvPlugin.js | 97.61% | 100% | 100% | 97.61% | 276, 395, 443, 456–457 | | EnvironmentPlugin.js | 100% | 100% | 100% | 100% | | | lib/deno | | DenoTargetPlugin.js | 100% | 100% | 100% | 100% | | | lib/dependencies | | ConstDependency.js | 100% | 100% | 100% | 100% | | | ContextElementDependency.js | 100% | 100% | 100% | 100% | | | NullDependency.js | 100% | 100% | 100% | 100% | | | lib/dependencies/amd | | AMDDefineDependency.js | 100% | 100% | 100% | 100% | | | AMDDefineDependencyParserPlugin.js | 100% | 100% | 100% | 100% | | | AMDPlugin.js | 99.31% | 100% | 100% | 99.31% | 54 | | AMDRequireArrayDependency.js | 100% | 100% | 100% | 100% | | | AMDRequireContextDependency.js | 100% | 100% | 100% | 100% | | | AMDRequireDependenciesBlock.js | 100% | 100% | 100% | 100% | | | AMDRequireDependenciesBlockParserPlugin.js | 100% | 100% | 100% | 100% | | | AMDRequireDependency.js | 100% | 100% | 100% | 100% | | | AMDRequireItemDependency.js | 100% | 100% | 100% | 100% | | | AMDRuntimeModules.js | 95.45% | 100% | 100% | 95.45% | 65 | | LocalModule.js | 100% | 100% | 100% | 100% | | | LocalModuleDependency.js | 100% | 100% | 100% | 100% | | | LocalModulesHelpers.js | 100% | 100% | 100% | 100% | | | RequireJsStuffPlugin.js | 100% | 100% | 100% | 100% | | | UnsupportedDependency.js | 100% | 100% | 100% | 100% | | | lib/dependencies/commonjs | | CommonJsDependencyHelpers.js | 98.63% | 100% | 100% | 98.63% | 43 | | CommonJsExportRequireDependency.js | 99.21% | 100% | 100% | 99.21% | 414, 416, |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Generated code size
Comparing base (3271edb) to head (9ee46e0). Merging this pull request will not change the code webpack generates.
| What moved |
Tests |
Assets |
Gzip |
Raw |
Test edit |
| Changed, test untouched |
0 |
0 |
— |
— |
— |
| Changed, test edited |
0 |
0 |
— |
— |
— |
| New |
0 |
0 |
— |
— |
— |
| Deleted |
0 |
0 |
— |
— |
— |
| Unchanged |
— |
9084 |
— |
— |
— |
Read Changed, test untouched first: the test is byte-identical on both sides, so webpack generated the difference. Changed, test edited moved partly because the test did — Test edit is how many bytes the test gained, and a bundle that grew by less is not a regression. New and Deleted are whole files, not deltas — a new asset was created, not grown, so it reads gray (⚪ added) — and adding tests cannot bury a real change. Gzip decides, because that is what users download; raw is the tiebreak, and brotli and zstd are per asset below.
No asset changed size.
No runtime gained or lost a runtime module.
Built test/configCases with the defaults a user gets: 2270 test(s), 9084 asset(s), 101 emitted nothing.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Repository: webpack/webpack/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8b1f2fa2-8a72-4c1e-a4fb-78ba612c77d3
📥 Commits
-
Reviewing files that changed from the base of the PR and between 3271edb and 9ee46e0.
⛔ Files ignored due to path filters: 7
-
test/unitCases/__snapshots__/syntax-printer-name-cache.unittest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
test/unitCases/css/__snapshots__/syntax.unittest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
test/unitCases/html/__snapshots__/syntax.unittest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
test/unitCases/javascript/__snapshots__/minify.unittest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
test/unitCases/javascript/__snapshots__/printer.unittest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
test/unitCases/json/__snapshots__/minify.unittest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
test/unitCases/xml/__snapshots__/minify.unittest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
📒 Files selected for processing: 38
-
TESTING_DOCS.md
cspell.json
docs/syntax.md
jest.config.js
package.json
test/helpers/syntaxEquivalence.js
test/unitCases/JavascriptSyntaxTree.unittest.js
test/unitCases/Parser.unittest.js
test/unitCases/RegExpValidator.unittest.js
test/unitCases/ScopeAnalyzerParity.unittest.js
test/unitCases/css/syntax.unittest.js
test/unitCases/html/entry-wrapper.unittest.js
test/unitCases/html/syntax.unittest.js
test/unitCases/javascript/minify.unittest.js
test/unitCases/javascript/no-acorn.unittest.js
test/unitCases/javascript/parser.unittest.js
test/unitCases/javascript/printer.unittest.js
test/unitCases/javascript/scope.unittest.js
test/unitCases/javascript/webpack-parser.unittest.js
test/unitCases/json/minify.unittest.js
test/unitCases/json/web-manifest.unittest.js
test/unitCases/syntax-printer-estree.unittest.js
test/unitCases/syntax-printer-name-cache.unittest.js
test/unitCases/syntax-printer-tree.unittest.js
test/unitCases/tooling/compare-css.unittest.js
test/unitCases/tooling/compare-harness.unittest.js
test/unitCases/tooling/compare-html.unittest.js
test/unitCases/tooling/compare-js.unittest.js
test/unitCases/tooling/compare-path-span-walk.unittest.js
test/unitCases/tooling/compare-purity.unittest.js
test/unitCases/tooling/compare-slices.unittest.js
test/unitCases/tooling/compare-spans.unittest.js
test/unitCases/tooling/compare-xml.unittest.js
test/unitCases/tooling/css-data.unittest.js
test/unitCases/xml/minify.unittest.js
tooling/COMPARE_TOOLS.md
tooling/compare-js-tools.js
tsconfig.types.test.json
💤 Files with no reviewable changes: 7
-
- test/unitCases/syntax-printer-name-cache.unittest.js
- test/unitCases/syntax-printer-tree.unittest.js
- test/unitCases/syntax-printer-estree.unittest.js
- test/unitCases/RegExpValidator.unittest.js
- test/unitCases/JavascriptSyntaxTree.unittest.js
- test/unitCases/Parser.unittest.js
- test/unitCases/ScopeAnalyzerParity.unittest.js
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
📝 Walkthrough
-
Unit tests now use nested language and tooling directories, and test discovery includes nested paths. Existing imports and references were updated for the new locations. JavaScript parser, printer, and scope suites gained regression coverage that replaces several deleted suites.
Changes: Unit test layout and coverage
| Layer / File(s) |
Summary |
Recursive test discovery jest.config.js, package.json, tsconfig.types.test.json, TESTING_DOCS.md |
Jest, unit-test and coverage scripts, and TypeScript configuration now discover tests recursively. The testing documentation describes the nested directory layout and pattern. |
Relocated test imports and references test/unitCases/css/*, test/unitCases/html/*, test/unitCases/javascript/minify.unittest.js, test/unitCases/javascript/no-acorn.unittest.js, test/unitCases/javascript/webpack-parser.unittest.js, test/unitCases/json/*, test/unitCases/xml/*, test/unitCases/tooling/*, cspell.json, test/helpers/syntaxEquivalence.js |
Existing tests and supporting references use paths that match the nested test directories. |
Parser and syntax-tree regression coverage test/unitCases/javascript/parser.unittest.js, test/unitCases/Parser.unittest.js, test/unitCases/RegExpValidator.unittest.js, test/unitCases/JavascriptSyntaxTree.unittest.js, TESTING_DOCS.md, tooling/COMPARE_TOOLS.md, tooling/compare-js-tools.js |
The JavaScript parser suite adds Acorn comparisons, parser API and tokenizer cases, regexp checks, and SyntaxTree reconstruction tests. It replaces three deleted suites. |
Printer and ESTree regression coverage test/unitCases/javascript/printer.unittest.js, test/unitCases/syntax-printer-estree.unittest.js, test/unitCases/syntax-printer-name-cache.unittest.js, test/unitCases/syntax-printer-tree.unittest.js, docs/syntax.md |
The printer suite adds SyntaxTree output, ESTree conversion, source-map, mangling, and name-cache comparisons with terser. It replaces three deleted suites. |
Scope analyzer compatibility coverage test/unitCases/javascript/scope.unittest.js, test/unitCases/ScopeAnalyzerParity.unittest.js |
The scope suite adds optional eslint-scope comparisons for scope trees and identifier resolutions, including webpack source files. It replaces the deleted parity suite. |
Possibly related PRs
- webpack/webpack#22132: Moves unit tests into
test/unitCases/; this PR continues the layout migration with nested directories and recursive discovery.
- webpack/webpack#22133: Moves focused suites into
test/unitCases/; this PR extends that migration to language and tooling subdirectories.
- webpack/webpack#22406: Changes JavaScript parser and printer behavior and updates syntax-printer tests and documentation; this PR relocates and consolidates related printer tests.
Suggested labels: area: tooling
Priority: ⬇️ Low
Change: Other
Merge Risk: ⚪ Minimal · up to 9ee46
-
This change only moves and consolidates unit tests and updates test discovery to match. Production code is unaffected, and the reorganized tests are still discovered by local runs and CI. No merge-blocking risk was found.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title uses the valid Conventional Commit form test: subject with an allowed type. It accurately describes the unit-test reorganization and JavaScript test merge. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning Some tools did not complete. Review the errors below.
🔧 ast-grep (0.45.3)
-
test/unitCases/javascript/printer.unittest.js
-
ast-grep timed out on this file
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Merging this PR will regress 3 benchmarks
⚠️ Unknown Walltime execution environment detected
Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.
For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.
⚠️ Different runtime environments detected
Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.
Open the report in CodSpeed to investigate
⚡ 46 improved benchmarks
❌ 3 regressed benchmarks
✅ 403 untouched benchmarks
⏩ 158 skipped benchmarks1
Performance Changes
|
Mode |
Benchmark |
BASE |
HEAD |
Efficiency |
| ❌ |
Memory |
benchmark "many-modules-commonjs", scenario '{"name":"mode-development","mode":"development"}' |
456.7 KB |
956.6 KB |
-52.26% |
| ❌ |
Memory |
unit benchmark "js-scope-analyzer-unit", parse 'typescript.js' |
405 KB |
792.2 KB |
-48.87% |
| ❌ |
WallTime |
benchmark "wasm-modules-sync", scenario '{"name":"mode-development","mode":"development"}' |
76.4 ms |
107 ms |
-28.54% |
| ⚡ |
WallTime |
unit benchmark "html-printer-unit", beautify (sparse inline style) |
1,607.4 µs |
332.8 µs |
×4.8 |
| ⚡ |
WallTime |
unit benchmark "html-printer-unit", minify (sparse inline style) |
1,520.2 µs |
351.2 µs |
×4.3 |
| ⚡ |
WallTime |
unit benchmark "js-minimizer-plugin-unit", minify entry by module path |
296.6 µs |
170 µs |
+74.44% |
| ⚡ |
WallTime |
unit benchmark "js-scope-analyzer-unit", analyze 'typescript.js' |
123.1 ms |
76 ms |
+62% |
| ⚡ |
WallTime |
unit benchmark "js-minimizer-plugin-unit", transform entry by function source |
330.8 µs |
210.5 µs |
+57.19% |
| ⚡ |
WallTime |
benchmark "many-modules-commonjs", scenario '{"name":"mode-development","mode":"development"}' |
44.6 ms |
29.3 ms |
+52.33% |
| ⚡ |
Memory |
benchmark "many-modules-esm", scenario '{"name":"mode-production","mode":"production"}' |
473.6 KB |
313.5 KB |
+51.05% |
| ⚡ |
WallTime |
benchmark "many-chunks-esm", scenario '{"name":"mode-development","mode":"development"}' |
43.3 ms |
29.3 ms |
+47.71% |
| ⚡ |
WallTime |
unit benchmark "js-printer-unit", print (three.module.js) |
86.6 ms |
59.9 ms |
+44.5% |
| ⚡ |
WallTime |
benchmark "many-chunks-commonjs", scenario '{"name":"mode-development","mode":"development"}' |
41.1 ms |
28.6 ms |
+43.57% |
| ⚡ |
WallTime |
benchmark "json-modules", scenario '{"name":"mode-development","mode":"development"}' |
28 ms |
19.5 ms |
+43.33% |
| ⚡ |
WallTime |
unit benchmark "js-printer-unit", mangle (three.module.js) |
125.2 ms |
88.7 ms |
+41.11% |
| ⚡ |
WallTime |
unit benchmark "js-printer-unit", print (lodash.js) |
42.4 ms |
30 ms |
+41.05% |
| ⚡ |
WallTime |
benchmark "many-chunks-esm", scenario '{"name":"mode-production","mode":"production"}' |
667 ms |
473.5 ms |
+40.87% |
| ⚡ |
WallTime |
benchmark "lodash", scenario '{"name":"mode-development","mode":"development"}' |
37.3 ms |
26.8 ms |
+39.49% |
| ⚡ |
WallTime |
benchmark "lodash", scenario '{"name":"mode-production","mode":"production"}' |
1.5 s |
1.1 s |
+39.22% |
| ⚡ |
WallTime |
benchmark "many-modules-commonjs", scenario '{"name":"mode-production","mode":"production"}' |
636.1 ms |
457.1 ms |
+39.16% |
| ... |
... |
... |
... |
... |
... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing refactor/unit-tests-by-language (9ee46e0) with main (3271edb)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|