📦 deps(thirdparty): update snapshots
This commit is contained in:
@@ -56,6 +56,10 @@ function parseArgs(argv) {
|
||||
}
|
||||
|
||||
function safeUserPath(pathValue, baseDir = process.cwd()) {
|
||||
if (path.isAbsolute(String(pathValue || ""))) {
|
||||
return path.resolve(pathValue);
|
||||
}
|
||||
|
||||
const root = path.resolve(baseDir);
|
||||
const segments = String(pathValue || "").split(/[\\/]+/).filter(Boolean).map((segment) => {
|
||||
const sanitized = sanitizeFilename(segment);
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
const { spawnSync } = require("child_process");
|
||||
|
||||
const repoRoot = path.resolve(__dirname, "..", "..", "..");
|
||||
const scriptPath = path.join(repoRoot, "tools", "scripts", "pr_preflight.cjs");
|
||||
|
||||
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "aas-pr-preflight-"));
|
||||
const eventPath = path.join(tempDir, "event.json");
|
||||
|
||||
fs.writeFileSync(
|
||||
eventPath,
|
||||
JSON.stringify({
|
||||
pull_request: {
|
||||
body: "## Quality Bar Checklist ✅\n\n- [x] Canonical skill location\n",
|
||||
},
|
||||
}),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
[
|
||||
scriptPath,
|
||||
"--base",
|
||||
"HEAD",
|
||||
"--head",
|
||||
"HEAD",
|
||||
"--event-path",
|
||||
eventPath,
|
||||
"--no-run",
|
||||
"--json",
|
||||
],
|
||||
{
|
||||
cwd: repoRoot,
|
||||
encoding: "utf8",
|
||||
},
|
||||
);
|
||||
|
||||
assert.strictEqual(result.status, 0, result.stderr || result.stdout);
|
||||
|
||||
const parsed = JSON.parse(result.stdout);
|
||||
assert.strictEqual(parsed.prBody.available, true);
|
||||
assert.strictEqual(parsed.prBody.hasQualityChecklist, true);
|
||||
Reference in New Issue
Block a user