File
Blob: tests/worker/runtime/objects/migrations.workers.test.ts
| 1 | import { env } from "cloudflare:workers"; |
| 2 | import { describe, expect, it } from "vitest"; |
| 3 | |
| 4 | describe("Durable Object startup migrations", () => { |
| 5 | it("runs AuthObject migrations in the worker runtime", async () => { |
| 6 | const stub = env.AUTH.get(env.AUTH.idFromName("auth:test")); |
| 7 | await expect(stub.ping()).resolves.toEqual({ ok: true, object: "auth" }); |
| 8 | }); |
| 9 | |
| 10 | it("runs FileDavObject migrations in the worker runtime", async () => { |
| 11 | const stub = env.FILE_DAV.get(env.FILE_DAV.idFromName("files:test")); |
| 12 | await expect(stub.ping()).resolves.toEqual({ ok: true, object: "file-dav" }); |
| 13 | }); |
| 14 | |
| 15 | it("runs CalDavObject migrations in the worker runtime", async () => { |
| 16 | const stub = env.CAL_DAV.get(env.CAL_DAV.idFromName("cal:test")); |
| 17 | await expect(stub.ping()).resolves.toEqual({ ok: true, object: "cal-dav" }); |
| 18 | }); |
| 19 | |
| 20 | it("runs CardDavObject migrations in the worker runtime", async () => { |
| 21 | const stub = env.CARD_DAV.get(env.CARD_DAV.idFromName("card:test")); |
| 22 | await expect(stub.ping()).resolves.toEqual({ ok: true, object: "card-dav" }); |
| 23 | }); |
| 24 | }); |