Files
workinf_Blender_Wasm/web/tests/unit/asset-catalog-restart.test.mjs
mes123456 5a11045ca5
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
Advance Blender 5.2 web parity through M12-03D
2026-08-17 17:30:27 -04:00

24 lines
1.2 KiB
JavaScript

import assert from "node:assert/strict";
import crypto from "node:crypto";
import fs from "node:fs";
import path from "node:path";
import test from "node:test";
const root = path.resolve(import.meta.dirname, "../../..");
const manifest = JSON.parse(fs.readFileSync(path.join(root, "tests/golden/M12-01H/manifest.json"), "utf8"));
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(path.join(root, file))).digest("hex");
test("M12-01H binds page and Worker restart identity evidence", () => {
assert.equal(manifest.task, "M12-01H");
assert.equal(manifest.enablingTask, true);
assert.equal(manifest.parityStateChange, false);
assert.equal(manifest.nextTask, "M12-01I");
assert.deepEqual(manifest.restart.contexts, ["INITIAL_PAGE", "RELOADED_PAGE", "WORKER_GENERATION_1", "WORKER_GENERATION_2"]);
assert.equal(manifest.restart.catalogOrder.length, manifest.restart.catalogCount);
assert.equal(manifest.restart.assetOrder.length, manifest.restart.assetCount);
assert.match(manifest.restart.manifestSha256, /^[a-f0-9]{64}$/);
for (const artifact of Object.values(manifest.artifacts)) {
assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
}
});