mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-21 05:32:53 +00:00
build(canvas): stabilize a2ui bundle inputs
This commit is contained in:
39
test/scripts/bundle-a2ui.test.ts
Normal file
39
test/scripts/bundle-a2ui.test.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
getLocalRolldownCliCandidates,
|
||||
isBundleHashInputPath,
|
||||
} from "../../scripts/bundle-a2ui.mjs";
|
||||
|
||||
describe("scripts/bundle-a2ui.mjs", () => {
|
||||
it("keeps generated renderer output out of bundle hash inputs", () => {
|
||||
const repoRoot = path.resolve("repo-root");
|
||||
|
||||
expect(
|
||||
isBundleHashInputPath(
|
||||
path.join(repoRoot, "vendor", "a2ui", "renderers", "lit", "src", "index.ts"),
|
||||
repoRoot,
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
isBundleHashInputPath(
|
||||
path.join(repoRoot, "vendor", "a2ui", "renderers", "lit", "dist"),
|
||||
repoRoot,
|
||||
),
|
||||
).toBe(false);
|
||||
expect(
|
||||
isBundleHashInputPath(
|
||||
path.join(repoRoot, "vendor", "a2ui", "renderers", "lit", "dist", "src", "index.js"),
|
||||
repoRoot,
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("prefers the installed rolldown CLI over a network dlx fallback", () => {
|
||||
const repoRoot = path.resolve("repo-root");
|
||||
|
||||
expect(getLocalRolldownCliCandidates(repoRoot)[0]).toBe(
|
||||
path.join(repoRoot, "node_modules", "rolldown", "bin", "cli.mjs"),
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user