4 lines
1.3 KiB
JavaScript
4 lines
1.3 KiB
JavaScript
#!/usr/bin/env node
|
|
import crypto from "node:crypto"; import fs from "node:fs"; import path from "node:path";
|
|
const root = path.resolve(path.dirname(new URL(import.meta.url).pathname), ".."); const docs = path.join(root, "docs"); const boundary = JSON.parse(fs.readFileSync(path.join(docs, "p6/help-source-boundary.json"), "utf8")); const fixture = { module: "Help", action: "python-api", entry: "src/Mod/Help/Help.py", readOnly: true, apiCount: 14 }; const inputSha256 = crypto.createHash("sha256").update(JSON.stringify(fixture)).digest("hex"); const report = { schema: "freecad-web-p6-help-action-02/v1", module: "Help", action: "python-api", result: "pass_contract", sourceRevision: boundary.sourceRevision, sourceEntry: fixture.entry, fixture, inputSha256, expectedResult: { apiCount: 14, readOnly: true, objectTypeCount: 0, registeredFormatExtensions: [] }, expectedError: { code: "revision_mismatch", field: "sourceRevision" }, workerCommand: "help.pythonApi", requestIdPattern: "help-python-*", chrome: { required: true, externalRequests: 0 }, persistence: "not_applicable_read_only", actionStatus: "pending_until_C_to_G" }; fs.writeFileSync(path.join(docs, "p6/help-action-02-python-api.json"), `${JSON.stringify(report, null, 2)}\n`); console.log(JSON.stringify({ result: report.result, action: report.action }));
|