vitest.config.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. import { fileURLToPath } from "node:url";
  2. import { defineConfig } from "vitest/config";
  3. const aiSrcIndex = fileURLToPath(new URL("../ai/src/index.ts", import.meta.url));
  4. const aiSrcOAuth = fileURLToPath(new URL("../ai/src/oauth.ts", import.meta.url));
  5. const agentSrcIndex = fileURLToPath(new URL("../agent/src/index.ts", import.meta.url));
  6. const tuiSrcIndex = fileURLToPath(new URL("../tui/src/index.ts", import.meta.url));
  7. export default defineConfig({
  8. test: {
  9. globals: true,
  10. environment: "node",
  11. testTimeout: 30000,
  12. server: {
  13. deps: {
  14. external: [/@silvia-odwyer\/photon-node/],
  15. },
  16. },
  17. },
  18. resolve: {
  19. alias: [
  20. { find: /^@earendil-works\/pi-ai$/, replacement: aiSrcIndex },
  21. { find: /^@earendil-works\/pi-ai\/oauth$/, replacement: aiSrcOAuth },
  22. { find: /^@earendil-works\/pi-agent-core$/, replacement: agentSrcIndex },
  23. { find: /^@earendil-works\/pi-tui$/, replacement: tuiSrcIndex },
  24. { find: /^@mariozechner\/pi-ai$/, replacement: aiSrcIndex },
  25. { find: /^@mariozechner\/pi-ai\/oauth$/, replacement: aiSrcOAuth },
  26. { find: /^@mariozechner\/pi-agent-core$/, replacement: agentSrcIndex },
  27. { find: /^@mariozechner\/pi-tui$/, replacement: tuiSrcIndex },
  28. ],
  29. },
  30. });