Prune notes that don't apply to bot-agents and keep aliases on direct src subfolders
Check / check (pull_request) Successful in 38s
Check / check (pull_request) Successful in 38s
This commit is contained in:
@@ -3,7 +3,7 @@ import { fileURLToPath } from "node:url";
|
||||
|
||||
import { expect, test } from "vite-plus/test";
|
||||
|
||||
import { output } from "#testing";
|
||||
import { runCommand } from "#testing";
|
||||
|
||||
// Each phase runs as `node src/<phase>.ts` with no build step. Node loads the
|
||||
// whole import graph, stripping types, before the phase reads its first
|
||||
@@ -16,12 +16,7 @@ const PHASES: [phase: string, firstVariable: string][] = [
|
||||
|
||||
test.each(PHASES)("Node loads the %s phase", async (phase, firstVariable) => {
|
||||
const path = fileURLToPath(new URL(`../src/${phase}.ts`, import.meta.url));
|
||||
const result = await output(process.execPath, {
|
||||
args: [path],
|
||||
env: { PATH: process.env.PATH ?? "" },
|
||||
clearEnv: true,
|
||||
stdin: "null",
|
||||
});
|
||||
const result = await runCommand(process.execPath, [path], { PATH: process.env.PATH ?? "" });
|
||||
expect(result.success).toBe(false);
|
||||
expect(new TextDecoder().decode(result.stderr)).toContain(`${firstVariable} is not set`);
|
||||
expect(result.stderr).toContain(`${firstVariable} is not set`);
|
||||
});
|
||||
|
||||
+13
-8
@@ -4,8 +4,12 @@ import process from "node:process";
|
||||
import { assert, expect, test } from "vite-plus/test";
|
||||
import { parse } from "yaml";
|
||||
|
||||
import { isMapping, isNotFound, makeTempDir, output } from "#testing";
|
||||
import type { JsonObject } from "#testing";
|
||||
import { makeTempDir, runCommand } from "#testing";
|
||||
|
||||
type JsonObject = Record<string, unknown>;
|
||||
|
||||
const isMapping = (value: unknown): value is JsonObject =>
|
||||
typeof value === "object" && value !== null && !Array.isArray(value);
|
||||
|
||||
const mapping = (value: unknown, at: string): JsonObject => {
|
||||
assert(isMapping(value), at);
|
||||
@@ -73,12 +77,13 @@ test("the source protection script stages immutable action files", async () => {
|
||||
const temp = await makeTempDir();
|
||||
const outputFile = `${temp}/output`;
|
||||
try {
|
||||
const result = await output("/bin/bash", {
|
||||
args: ["scripts/protect-source.sh"],
|
||||
env: { ACTION_PATH: process.cwd(), GITHUB_OUTPUT: outputFile, RUNNER_TEMP: temp },
|
||||
stderr: "piped",
|
||||
const result = await runCommand("/bin/bash", ["scripts/protect-source.sh"], {
|
||||
...process.env,
|
||||
ACTION_PATH: process.cwd(),
|
||||
GITHUB_OUTPUT: outputFile,
|
||||
RUNNER_TEMP: temp,
|
||||
});
|
||||
assert(result.success, new TextDecoder().decode(result.stderr));
|
||||
assert(result.success, result.stderr);
|
||||
|
||||
const path = (await readFile(outputFile, "utf8")).trim().slice(5);
|
||||
const files = [
|
||||
@@ -147,7 +152,7 @@ test("uses the standard Skills installer without custom discovery", async () =>
|
||||
assert(runner.includes("skills add obra/superpowers"));
|
||||
const removed = await stat("superpowers.ts").then(
|
||||
() => false,
|
||||
(error: unknown) => isNotFound(error),
|
||||
(error: unknown) => error instanceof Error && "code" in error && error.code === "ENOENT",
|
||||
);
|
||||
assert(removed, "superpowers.ts should be removed");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user