22 lines
1.2 KiB
JavaScript
22 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-02H/manifest.json"), "utf8"));
|
|
const desktop = JSON.parse(fs.readFileSync(path.join(root, "tests/golden/M12-02H/desktop-report.json"), "utf8"));
|
|
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(path.join(root, file))).digest("hex");
|
|
|
|
test("M12-02H binds desktop, main-thread, Offscreen, and metric evidence", () => {
|
|
assert.equal(manifest.task, "M12-02H");
|
|
assert.equal(manifest.enablingTask, false);
|
|
assert.equal(manifest.parityStateChange, true);
|
|
assert.equal(manifest.implementationClass, "LOCAL_EXACT");
|
|
assert.equal(manifest.nextTask, "M12-03A");
|
|
assert.deepEqual(manifest.backends, ["BLENDER_5_2_DESKTOP", "MAIN_THREAD_CANVAS_2D", "OFFSCREEN_CANVAS_2D"]);
|
|
assert.equal(desktop.rgbaSha256, manifest.reference.rgbaSha256);
|
|
for (const artifact of Object.values(manifest.artifacts)) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
|
});
|