fix: make workspace export runtime-safe
This commit is contained in:
@@ -1,8 +1,28 @@
|
||||
import { execFile } from "node:child_process";
|
||||
import { promisify } from "node:util";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { AGENT_RUNTIME_PACKAGE } from "@aiquant/agent-runtime";
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
|
||||
describe("workspace smoke test", () => {
|
||||
it("resolves cross-workspace package exports", () => {
|
||||
expect(AGENT_RUNTIME_PACKAGE).toBe("agent-runtime");
|
||||
});
|
||||
|
||||
it("allows plain node to import the workspace package", async () => {
|
||||
const { stdout } = await execFileAsync(
|
||||
process.execPath,
|
||||
[
|
||||
"--input-type=module",
|
||||
"--eval",
|
||||
"import('@aiquant/agent-runtime').then((mod) => console.log(mod.AGENT_RUNTIME_PACKAGE));",
|
||||
],
|
||||
{
|
||||
cwd: new URL("..", import.meta.url),
|
||||
},
|
||||
);
|
||||
|
||||
expect(stdout.trim()).toBe("agent-runtime");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user