@devries-cameron20 / t3code Mirror · read-only
Fork 0

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, 06:00 UTC

main
ts 35 lines 1.39 KB
Raw
1 import { describe, expect, it } from "vitest";
2 import { NODE_BUNDLE_CONDITIONS } from "../../core/NodeServe.ts";
3 import { ADAPTER_NAME as MARKER_NAME, node } from "../node-adapter.ts";
4 import {
5 ADAPTER_NAME,
6 ADAPTER_PACKAGE,
7 SERVER_ENTRY_FILE_NAME,
8 makeNodeTarget,
9 target,
10 } from "../node.ts";
11
12 describe("makeNodeTarget", () => {
13 it("accepts native Node output without an application adapter", () => {
14 const nodeTarget = makeNodeTarget({ compatibilityDate: "2026-03-10" });
15 expect(nodeTarget.platform).toBe("node");
16 expect(nodeTarget.requiresAdapter).not.toBe(true);
17 expect(nodeTarget.adapterName).toBe(ADAPTER_NAME);
18 expect(nodeTarget.adapterPackage).toBe(ADAPTER_PACKAGE);
19 expect(nodeTarget.serverEntryFileName).toBe(SERVER_ENTRY_FILE_NAME);
20 expect(SERVER_ENTRY_FILE_NAME).toBe("entry.js");
21 expect(nodeTarget.bundle?.conditions).toEqual([...NODE_BUNDLE_CONDITIONS]);
22 expect(nodeTarget.finish).toBeTypeOf("function");
23 expect(nodeTarget.build).toBeTypeOf("function");
24 });
25
26 it("exposes a dependency-free marker adapter named node", () => {
27 expect(MARKER_NAME).toBe("node");
28 expect(node()).toEqual({ name: "node", serverTarget: "node" });
29 expect(ADAPTER_PACKAGE).toBe("@alchemy.run/frontend-frameworks/octane/node-adapter");
30 });
31
32 it("exposes the named `target` module export as the factory", () => {
33 expect(target).toBe(makeNodeTarget);
34 });
35 });