test: add coverage for generateStatsFile and statsFilename - #735
test: add coverage for generateStatsFile and statsFilename#735topdaily-dev wants to merge 1 commit into
Conversation
|
|
|
6f3c22c to
f199df2
Compare
|
Please fill the pull request template as it was. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #735 +/- ##
==========================================
+ Coverage 78.58% 79.52% +0.94%
==========================================
Files 17 17
Lines 1060 1060
Branches 383 383
==========================================
+ Hits 833 843 +10
+ Misses 199 189 -10
Partials 28 28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What
Adds plugin-level test coverage for the
generateStatsFileandstatsFilenameoptions.Why
Both are documented public options, but neither had any coverage at the plugin level. The existing
test/statsUtils.jsonly exercises the low-levelwriteStatshelper, so the option wiring inBundleAnalyzerPluginwas never verified by CI — including themkdircall that creates missing directories for a nestedstatsFilename.What is covered
generateStatsFile: truewrites the stats file (Webpack 4 and 5)statsFilenamestatsFilename, which exercises the recursive directory creationstatsFilenameThe tests use
analyzerMode: "disabled"together withgenerateStatsFile: true, which is the combination described in the README for generating only the stats file.Verification
npm run lintand the test suite both pass locally. I also confirmed the tests are meaningful by temporarily short-circuiting thegenerateStatsFilebranch inBundleAnalyzerPlugin: the five positive tests fail and the negative one still passes.No production code is changed in this PR.