fix engine build and test resolution
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { PathLike } from "node:fs";
|
||||
|
||||
const createAgentSessionMock = vi.fn();
|
||||
const createCodingToolsMock = vi.fn(() => []);
|
||||
@@ -18,7 +19,7 @@ const settingsManagerInMemoryMock = vi.fn(() => ({ kind: "settings-manager" }));
|
||||
const setFallbackResolverMock = vi.fn();
|
||||
const reloadMock = vi.fn(async () => {});
|
||||
const execSyncMock = vi.fn(() => "");
|
||||
const existsSyncMock = vi.fn(() => false);
|
||||
const existsSyncMock = vi.fn((_path: PathLike) => false);
|
||||
const readFileSyncMock = vi.fn(() => "{}");
|
||||
|
||||
vi.mock("node:child_process", () => ({
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
import { availableParallelism } from "node:os";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
const defaultMaxWorkers = Math.max(1, Math.min(4, Math.ceil(availableParallelism() / 8)));
|
||||
const maxWorkers = Number.parseInt(process.env.VITEST_MAX_WORKERS ?? String(defaultMaxWorkers), 10);
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
"@fusion/core": resolve(__dirname, "../core/src/index.ts"),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
include: ["src/**/*.test.ts"],
|
||||
maxWorkers,
|
||||
|
||||
Reference in New Issue
Block a user