Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pstack/skills/statechart/scripts/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ async function findTlc(cwd: string) {
};
}

const exitClass = (status: number | null) =>
const exitClass = (status: number | null): CheckResult["exit"] =>
status === 0 ? 0 : status === 11 || status === 12 || status === 13 ? 1 : 2;

const tail = (r: FileResult) => {
Expand Down
14 changes: 8 additions & 6 deletions pstack/skills/statechart/scripts/test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ for (const signal of ["SIGINT", "SIGTERM"] satisfies NodeJS.Signals[]) {
test(
`${signal} while the view draws the chart stops the command, and it writes nothing`,
{ timeout: 60_000 },
() =>
signalWhile(signal, (fakes) => {
async () => {
await signalWhile(signal, (fakes) => {
const drawing = path.join(fakes, "drawing");
const dir = copyCase("Login", (d) =>
fs.writeFileSync(
Expand All @@ -444,14 +444,15 @@ for (const signal of ["SIGINT", "SIGTERM"] satisfies NodeJS.Signals[]) {
),
);
return { dir, reached: () => fs.existsSync(drawing) };
}),
});
},
);

test(
`${signal} while the command writes its files stops it, and it writes nothing`,
{ timeout: 60_000 },
() =>
signalWhile(signal, () => ({
async () => {
await signalWhile(signal, () => ({
dir: gridCase(150),
reached: (parent) => {
for (const f of fs.readdirSync(parent, { recursive: true, encoding: "utf8" }))
Expand All @@ -462,7 +463,8 @@ for (const signal of ["SIGINT", "SIGTERM"] satisfies NodeJS.Signals[]) {
return true;
return false;
},
})),
}));
},
);
}

Expand Down
Loading