Build checked asynchronous service registries with Nix
This commit is contained in:
@@ -114,3 +114,28 @@ test("checked receipts bind regenerated code, generator identity and manifests",
|
||||
/replaced or omitted/,
|
||||
);
|
||||
});
|
||||
|
||||
test("remote JS modules witness generated adapters without imposing TypeScript on custom services", async () => {
|
||||
const { asyncObjectPlan } = await import("./async-fixture.js");
|
||||
const { expectedArtifactReceipt, checkArtifactReceipt } = await import("../src/execution-world/receipts.js");
|
||||
const plan = await asyncObjectPlan(),
|
||||
fixture = buildArtifactFixture(plan, "async:provider-runtime@2"),
|
||||
generator = "a".repeat(64);
|
||||
fixture.manifest.implementations = fixture.manifest.implementations.filter(
|
||||
(implementation) => implementation.target === "server",
|
||||
);
|
||||
const { receipt, sources } = expectedArtifactReceipt(plan, fixture.manifest, generator);
|
||||
assert.deepEqual(
|
||||
receipt.generated.map((file) => file.path),
|
||||
["share/quixos/generated/remote.ts"],
|
||||
);
|
||||
await checkArtifactReceipt(plan, fixture.manifest, receipt, generator, async (_revision, path) => sources.get(path)!);
|
||||
await assert.rejects(
|
||||
checkArtifactReceipt(plan, fixture.manifest, receipt, generator, async () => new Uint8Array()),
|
||||
/replaced or omitted/,
|
||||
);
|
||||
fixture.manifest.implementations = fixture.manifest.implementations.filter(
|
||||
(implementation) => implementation.compatibility === "quixos-service-v1",
|
||||
);
|
||||
assert.deepEqual(expectedArtifactReceipt(plan, fixture.manifest, generator).receipt.generated, []);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user