Initial commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// packages/{{kebabCase feature}}/src/realtime/handlers/on-{{kebabCase channelSlug}}.handler.test.ts
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { on{{pascalCase channelSlug}}Handler } from "@/realtime/handlers/on-{{kebabCase channelSlug}}.handler";
|
||||
|
||||
describe("on{{pascalCase channelSlug}}Handler", () => {
|
||||
it("returns a function (factory shape)", () => {
|
||||
const handler = on{{pascalCase channelSlug}}Handler();
|
||||
expect(typeof handler).toBe("function");
|
||||
});
|
||||
|
||||
it("does not throw on a valid stub input", async () => {
|
||||
const handler = on{{pascalCase channelSlug}}Handler();
|
||||
await expect(
|
||||
handler({} as never, { userId: "u1", roles: [] }),
|
||||
).resolves.toBeUndefined();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user