14 lines
772 B
JavaScript
14 lines
772 B
JavaScript
import assert from "node:assert/strict";
|
|
import { readFile } from "node:fs/promises";
|
|
|
|
const files = ["index.html", "app.mjs", "worker-client.mjs", "styles.css", "controls.mjs", "state-panel.mjs", "project-workflow.mjs", "recovery-panel.mjs", "device-panel.mjs", "hal-panel.mjs", "machine-view.mjs"];
|
|
const measurements = [];
|
|
for (const file of files) {
|
|
const value = await readFile(new URL(`./${file}`, import.meta.url), "utf8");
|
|
assert.ok(value.length > 0);
|
|
measurements.push({ file, bytes: Buffer.byteLength(value) });
|
|
}
|
|
const totalBytes = measurements.reduce((total, row) => total + row.bytes, 0);
|
|
assert.ok(totalBytes > 1000);
|
|
console.log(JSON.stringify({ schema: "browser-performance-sample.v1", files: measurements, total_bytes: totalBytes, stable: true }));
|