refactor(native): bound nested path checks and verify real ticket coverage
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { expect, it } from "vitest";
|
||||
import { unconfirmedNestedCode } from "./NativeNestedCode.js";
|
||||
|
||||
it("observes cancellation between nested filesystem lookups", async () => {
|
||||
const controller = new AbortController();
|
||||
const paths: string[] = [];
|
||||
await expect(
|
||||
unconfirmedNestedCode(
|
||||
{
|
||||
path: "/app",
|
||||
status: "valid",
|
||||
exit_code: 0,
|
||||
diagnostics: [],
|
||||
validated_nested_code: ["/app/first", "/app/second"],
|
||||
},
|
||||
controller.signal,
|
||||
{
|
||||
lookup: async (path) => {
|
||||
paths.push(path);
|
||||
controller.abort();
|
||||
},
|
||||
names: async () => [],
|
||||
},
|
||||
),
|
||||
).rejects.toMatchObject({ name: "AbortError" });
|
||||
expect(paths).toEqual(["/app/first"]);
|
||||
});
|
||||
Reference in New Issue
Block a user