| 1 | import { describe, expect, it } from "vitest"; |
| 2 | import cloudflare from "../cloudflare.ts"; |
| 3 | |
| 4 | describe("Vocs Cloudflare target", () => { |
| 5 | it("adds nodejs_compat for the Vocs server runtime", () => { |
| 6 | expect( |
| 7 | cloudflare({ |
| 8 | worker: { compatibilityFlags: ["some_other_flag"] }, |
| 9 | }).config?.compatibilityFlags, |
| 10 | ).toEqual(["some_other_flag", "nodejs_compat"]); |
| 11 | }); |
| 12 | |
| 13 | it("does not duplicate nodejs_compat", () => { |
| 14 | expect( |
| 15 | cloudflare({ |
| 16 | worker: { compatibilityFlags: ["nodejs_compat"] }, |
| 17 | }).config?.compatibilityFlags, |
| 18 | ).toEqual(["nodejs_compat"]); |
| 19 | }); |
| 20 | }); |