Avoid recursive import in api mock for bun tests
This commit is contained in:
parent
09711d0465
commit
2e735a7df4
1 changed files with 10 additions and 9 deletions
|
|
@ -13,16 +13,17 @@ vi.mock("convex/browser", () => ({
|
||||||
ConvexHttpClient: vi.fn(() => ({ mutation: mutationMock })),
|
ConvexHttpClient: vi.fn(() => ({ mutation: mutationMock })),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
vi.mock("@/convex/_generated/api", async () => {
|
vi.mock("@/convex/_generated/api", () => ({
|
||||||
const actual = await import("@/convex/_generated/api")
|
|
||||||
return {
|
|
||||||
...actual,
|
|
||||||
api: {
|
api: {
|
||||||
...actual.api,
|
|
||||||
users: { ensureUser: "users:ensureUser" },
|
users: { ensureUser: "users:ensureUser" },
|
||||||
|
devices: {
|
||||||
|
heartbeat: "devices:heartbeat",
|
||||||
|
upsertInventory: "devices:upsertInventory",
|
||||||
|
findByAuthEmail: "devices:findByAuthEmail",
|
||||||
|
remove: "devices:remove",
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
})
|
}))
|
||||||
|
|
||||||
describe("POST /api/admin/devices/rename", () => {
|
describe("POST /api/admin/devices/rename", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue