mirror of
https://github.com/apache/superset.git
synced 2026-08-05 13:32:41 +00:00
test: cover bundle-size-summary.js and fail loudly on missing entrypoints
Addresses review feedback: validate every tracked entrypoint is present in stats.json (fail instead of silently skipping) and add unit tests for the summary script. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -59,7 +59,10 @@ function main() {
|
||||
const results = [];
|
||||
TRACKED_ENTRYPOINTS.forEach(name => {
|
||||
const entrypoint = entrypoints[name];
|
||||
if (!entrypoint) return;
|
||||
if (!entrypoint) {
|
||||
console.error(`stats.json is missing the "${name}" entrypoint`);
|
||||
process.exit(1);
|
||||
}
|
||||
results.push({
|
||||
name: `${name} entrypoint (JS)`,
|
||||
unit: 'bytes',
|
||||
@@ -75,4 +78,8 @@ function main() {
|
||||
console.log(JSON.stringify(results, null, 2));
|
||||
}
|
||||
|
||||
main();
|
||||
if (require.main === module) {
|
||||
main();
|
||||
}
|
||||
|
||||
module.exports = { entrypointSizeByExt, main, TRACKED_ENTRYPOINTS };
|
||||
|
||||
Reference in New Issue
Block a user