The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { describe, expect, it } from "vitest"; |
| 2 | import { RuntimeSubpathExportPlugin } from "../../internal/build-tools/RuntimeSubpathExportPlugin.ts"; |
| 3 | |
| 4 | describe("runtime subpath exports", () => { |
| 5 | it.each([ |
| 6 | [ |
| 7 | "shared wire constants", |
| 8 | "../../core/globals/EntryOptions.shared.ts", |
| 9 | "/workspace/packages/cloudflare-runtime/src/vite/module-runner/constants.shared.ts", |
| 10 | "@alchemy.run/cloudflare-runtime/core/globals/EntryOptions", |
| 11 | ], |
| 12 | [ |
| 13 | "POSIX", |
| 14 | "../core/index.ts", |
| 15 | "/workspace/packages/cloudflare-runtime/src/vite/plugin.ts", |
| 16 | "@alchemy.run/cloudflare-runtime/core", |
| 17 | ], |
| 18 | [ |
| 19 | "Windows", |
| 20 | "..\\rolldown\\options.ts", |
| 21 | "D:\\a\\alchemy\\alchemy\\packages\\cloudflare-runtime\\src\\vite\\plugin.ts", |
| 22 | "@alchemy.run/cloudflare-runtime/rolldown/options", |
| 23 | ], |
| 24 | ])("maps %s relative imports to public package exports", (_, source, importer, expected) => { |
| 25 | const resolveId = RuntimeSubpathExportPlugin().resolveId; |
| 26 | expect(resolveId).toBeTypeOf("function"); |
| 27 | if (typeof resolveId !== "function") { |
| 28 | return; |
| 29 | } |
| 30 | |
| 31 | expect(resolveId.call({} as never, source, importer, {} as never)).toEqual({ |
| 32 | id: expected, |
| 33 | external: true, |
| 34 | }); |
| 35 | }); |
| 36 | }); |