Initial Commit

This commit is contained in:
2026-05-27 23:29:53 +01:00
commit fbc70f96e6
10000 changed files with 1102152 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { describe, expectTypeOf, it } from "@suaveplan/testing/runner";
import type { MutexRelease, PluginMutex } from "./mutex-contract.js";
describe("mutex-contract spec-conformance", () => {
it("PluginMutex declares acquire tryAcquire", { timeout: 5000 }, () => {
expectTypeOf<PluginMutex>().toHaveProperty("acquire");
expectTypeOf<PluginMutex>().toHaveProperty("tryAcquire");
expectTypeOf<PluginMutex["acquire"]>().toEqualTypeOf<
(plugin: string) => Promise<MutexRelease>
>();
expectTypeOf<PluginMutex["tryAcquire"]>().toEqualTypeOf<
(plugin: string) => MutexRelease | null
>();
});
it("MutexRelease declares release", { timeout: 5000 }, () => {
expectTypeOf<MutexRelease>().toHaveProperty("release");
expectTypeOf<MutexRelease["release"]>().toEqualTypeOf<() => void>();
});
});