mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-10-27 23:27:09 +09:00
16 lines
468 B
TypeScript
16 lines
468 B
TypeScript
import { describe, expect, test } from "vitest";
|
|
import { TRPCError } from "@trpc/server";
|
|
import { throwApiError } from "./api-errors.server";
|
|
|
|
describe("api errors", () => {
|
|
test("throws public api trpc errors", () => {
|
|
expect.assertions(2);
|
|
try {
|
|
throwApiError("NOT_FOUND", "Missing");
|
|
} catch (error) {
|
|
expect(error).toBeInstanceOf(TRPCError);
|
|
expect(error).toMatchObject({ code: "NOT_FOUND", message: "Missing" });
|
|
}
|
|
});
|
|
});
|