Initial Commit
This commit is contained in:
@@ -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>();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user