Skip to content

Commit 3fc33b5

Browse files
committed
test(apps): alias capacitor sources in app-contacts and app-wifi tests
The vitest configs for plugins/app-contacts and plugins/app-wifi now resolve @elizaos/capacitor-{contacts,wifi} to the package src/index.ts, mirroring plugins/app-phone. Without this alias, vitest tries to load the package's dist/ entry and fails in CI (`bun run test:plugins` only builds the four core packages, not the native-plugin capacitor packages), breaking the Plugin Tests job: Failed to resolve entry for package "@elizaos/capacitor-contacts". The package may have incorrect main/module/exports specified in its package.json. Verified locally by removing both packages' dist directories before running each plugin's vitest suite.
1 parent 4b45fd0 commit 3fc33b5

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

plugins/app-contacts/vitest.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
import { dirname, resolve } from "node:path";
2+
import { fileURLToPath } from "node:url";
13
import { defineConfig } from "vitest/config";
24

5+
const rootDir = dirname(fileURLToPath(import.meta.url));
6+
37
export default defineConfig({
8+
resolve: {
9+
alias: {
10+
"@elizaos/capacitor-contacts": resolve(
11+
rootDir,
12+
"../../packages/native-plugins/contacts/src/index.ts",
13+
),
14+
},
15+
},
416
test: {
517
include: ["test/**/*.test.ts", "src/**/*.test.ts"],
618
passWithNoTests: true,

plugins/app-wifi/vitest.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
import { dirname, resolve } from "node:path";
2+
import { fileURLToPath } from "node:url";
13
import { defineConfig } from "vitest/config";
24

5+
const rootDir = dirname(fileURLToPath(import.meta.url));
6+
37
export default defineConfig({
8+
resolve: {
9+
alias: {
10+
"@elizaos/capacitor-wifi": resolve(
11+
rootDir,
12+
"../../packages/native-plugins/wifi/src/index.ts",
13+
),
14+
},
15+
},
416
test: {
517
include: ["test/**/*.test.ts", "src/**/*.test.ts"],
618
passWithNoTests: true,

0 commit comments

Comments
 (0)