fix: add missing vitest aliases and mock export for CI test failures
Three root causes behind CI run 28695362549 failures: 1. droid-cli: 8 tests fail with 'Failed to resolve entry for @fusion-plugin-examples/droid-runtime'. The droid-cli vitest config had no source alias for the droid-runtime plugin, so Vite tried to resolve non-existent dist/ exports. 2. CLI: multiple tests fail with 'Failed to resolve entry for @fusion-plugin-examples/roadmap'. The CLI vitest config was missing source aliases for the roadmap plugin (., /server, /roadmap-suggestions). 3. CLI: 73 bin.test.ts tests fail with 'No runTaskImportFromGitLab export is defined on the ../commands/task.js mock'. The GitLab import command was added to bin.ts and task.ts but the bin.test.ts mock was not updated to include the new export.
This commit is contained in:
@@ -25,6 +25,7 @@ const commandMocks = vi.hoisted(() => ({
|
||||
runTaskUnpause: vi.fn(),
|
||||
runTaskImportFromGitHub: vi.fn(),
|
||||
runTaskImportGitHubInteractive: vi.fn(),
|
||||
runTaskImportFromGitLab: vi.fn(),
|
||||
runTaskDuplicate: vi.fn(),
|
||||
runTaskArchive: vi.fn(),
|
||||
runTaskUnarchive: vi.fn(),
|
||||
@@ -171,6 +172,7 @@ vi.mock("../commands/task.js", () => ({
|
||||
runTaskUnpause: commandMocks.runTaskUnpause,
|
||||
runTaskImportFromGitHub: commandMocks.runTaskImportFromGitHub,
|
||||
runTaskImportGitHubInteractive: commandMocks.runTaskImportGitHubInteractive,
|
||||
runTaskImportFromGitLab: commandMocks.runTaskImportFromGitLab,
|
||||
runTaskDuplicate: commandMocks.runTaskDuplicate,
|
||||
runTaskArchive: commandMocks.runTaskArchive,
|
||||
runTaskUnarchive: commandMocks.runTaskUnarchive,
|
||||
|
||||
@@ -90,6 +90,22 @@ export default defineConfig({
|
||||
find: /^@fusion-plugin-examples\/cursor-runtime$/,
|
||||
replacement: resolve(__dirname, "../../plugins/fusion-plugin-cursor-runtime/src/index.ts"),
|
||||
},
|
||||
/*
|
||||
FNXC:PluginTests 2026-07-04-09:30:
|
||||
The roadmap plugin (@fusion-plugin-examples/roadmap) is imported by the CLI extension. Without source aliases, Vite resolves to the dist/ exports which don't exist in a source checkout.
|
||||
*/
|
||||
{
|
||||
find: /^@fusion-plugin-examples\/roadmap\/server$/,
|
||||
replacement: resolve(__dirname, "../../plugins/fusion-plugin-roadmap/src/server/index.ts"),
|
||||
},
|
||||
{
|
||||
find: /^@fusion-plugin-examples\/roadmap\/roadmap-suggestions$/,
|
||||
replacement: resolve(__dirname, "../../plugins/fusion-plugin-roadmap/src/roadmap-suggestions.ts"),
|
||||
},
|
||||
{
|
||||
find: /^@fusion-plugin-examples\/roadmap$/,
|
||||
replacement: resolve(__dirname, "../../plugins/fusion-plugin-roadmap/src/index.ts"),
|
||||
},
|
||||
{ find: /^@fusion\/test-utils$/, replacement: resolve(__dirname, "../core/src/__test-utils__/workspace.ts") },
|
||||
],
|
||||
},
|
||||
|
||||
@@ -5,6 +5,16 @@ import { computeMaxWorkers } from "../core/src/__test-utils__/vitest-workers";
|
||||
const maxWorkers = computeMaxWorkers();
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
/*
|
||||
FNXC:PluginTests 2026-07-04-09:30:
|
||||
droid-cli's index.test.ts imports @fusion-plugin-examples/droid-runtime, but without a source alias Vite tries to resolve the package's dist/ exports which don't exist in a source checkout, causing every droid-cli test to fail with 'Failed to resolve entry for package'.
|
||||
*/
|
||||
"@fusion-plugin-examples/droid-runtime/probe": resolve(__dirname, "../../plugins/fusion-plugin-droid-runtime/src/probe.ts"),
|
||||
"@fusion-plugin-examples/droid-runtime": resolve(__dirname, "../../plugins/fusion-plugin-droid-runtime/src/index.ts"),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
setupFiles: [
|
||||
|
||||
Reference in New Issue
Block a user