Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/chrisvander/crate. The future of cloud storage.
Something went wrong. Try again.
12345678910111213141516171819import { describe, expect, it } from "vitest"import { unwrap } from "./api"
describe("generated client response boundary", () => { it("accepts successful creation responses, not just status 200", () => { expect(unwrap({ data: { id: "new" }, response: new Response(null, { status: 201 }) })).toEqual({ id: "new", }) }) it("preserves structured failure details without mutating presentation state", () => { expect(() => unwrap({ error: { code: "conflict", message: "The file changed on another device." }, response: new Response(null, { status: 409 }), }), ).toThrow("The file changed on another device.") })})