mirror of
https://github.com/nexu-io/open-design.git
synced 2026-09-20 06:15:06 +08:00
4b48f94b7c
* refactor(ci): align tools-pack sources with scope boundaries * refactor(tools-pack): unify test source imports * fix(tools-pack): resolve workspace root from package Generated-By: looper 0.11.2 (runner=fixer, agent=codex) * test(tools-pack): exercise bundled CLI directly --------- Co-authored-by: Looper <looper@noreply.github.com>
26 lines
881 B
TypeScript
26 lines
881 B
TypeScript
import { execFile } from "node:child_process";
|
|
import { promisify } from "node:util";
|
|
import { dirname, resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const execFileAsync = promisify(execFile);
|
|
const toolPackRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
|
|
|
|
describe("built tools-pack CLI", () => {
|
|
it("resolves workspace configuration from the bundled entry", async () => {
|
|
await execFileAsync(process.execPath, ["esbuild.config.mjs"], { cwd: toolPackRoot });
|
|
|
|
const invocation = execFileAsync(
|
|
process.execPath,
|
|
["dist/index.mjs", "linux", "unsupported-built-smoke"],
|
|
{ cwd: toolPackRoot },
|
|
);
|
|
|
|
await expect(invocation).rejects.toMatchObject({
|
|
stderr: expect.stringContaining("unsupported linux action: unsupported-built-smoke"),
|
|
});
|
|
});
|
|
});
|