mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix: resolve workspace source dependencies in tests
This commit is contained in:
parent
c30cda1d43
commit
6ee906d3d2
5 changed files with 18 additions and 10 deletions
|
|
@ -10,6 +10,7 @@ import { SettingsManager } from "../src/core/settings-manager.ts";
|
|||
import { createSessionManager } from "../src/main.ts";
|
||||
|
||||
const cliPath = resolve(__dirname, "../src/cli.ts");
|
||||
const sourceResolverPath = resolve(__dirname, "../src/experimental/source-resolver.ts");
|
||||
const tempDirs: string[] = [];
|
||||
|
||||
afterEach(() => {
|
||||
|
|
@ -54,13 +55,12 @@ async function runCli(args: string[]): Promise<{ code: number | null; agentDir:
|
|||
mkdirSync(projectDir, { recursive: true });
|
||||
|
||||
const code = await new Promise<number | null>((resolvePromise, reject) => {
|
||||
const child = spawn(process.execPath, [cliPath, ...args], {
|
||||
const child = spawn(process.execPath, ["--import", sourceResolverPath, cliPath, ...args], {
|
||||
cwd: projectDir,
|
||||
env: {
|
||||
...process.env,
|
||||
[ENV_AGENT_DIR]: agentDir,
|
||||
PI_OFFLINE: "1",
|
||||
TSX_TSCONFIG_PATH: resolve(__dirname, "../../../tsconfig.json"),
|
||||
},
|
||||
stdio: ["ignore", "ignore", "ignore"],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue