1import { describe, expect, it } from "vitest";
2import { NODE_BUNDLE_CONDITIONS } from "../../core/NodeServe.ts";
3import { makeNodeTarget, target } from "../node.ts";
4
5describe("makeNodeTarget", () => {
6 it("is a node target with a wholesale child build and a serve-entry finish", () => {
7 const node = makeNodeTarget();
8 expect(node.platform).toBe("node");
9 expect(node.build).toBeTypeOf("function");
10 expect(node.finish).toBeTypeOf("function");
11 expect(node.bundle?.conditions).toEqual([...NODE_BUNDLE_CONDITIONS]);
12 expect(typeof node.adapter).toBe("function");
13 expect(typeof node.vitePlugins).toBe("function");
14 });
15
16 it("exposes the named `target` module export as the factory", () => {
17 expect(target).toBe(makeNodeTarget);
18 });
19});