Skip to content

The open alternative to Salesforce, designed for AI.

Resolve src imports in example app tests on vite 8.1 (#29044)

Félix Malfait8c62406ae3ce
diff --git a/packages/twenty-apps/examples/hello-world/vitest.config.ts b/packages/twenty-apps/examples/hello-world/vitest.config.ts
index 1f844105d12..c6b704f3a00 100644
--- a/packages/twenty-apps/examples/hello-world/vitest.config.ts
+++ b/packages/twenty-apps/examples/hello-world/vitest.config.ts
@@ -1,8 +1,11 @@
+import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
export default defineConfig({
resolve: {
tsconfigPaths: true,
+ // tsconfig.json excludes the tests, and since vite 8.1 its paths no longer apply to them
+ alias: { src: fileURLToPath(new URL('./src', import.meta.url)) },
},
test: {
testTimeout: 120_000,
diff --git a/packages/twenty-apps/examples/postcard/vitest.config.ts b/packages/twenty-apps/examples/postcard/vitest.config.ts
index a22f3b6c310..bf1ca3eb6b5 100644
--- a/packages/twenty-apps/examples/postcard/vitest.config.ts
+++ b/packages/twenty-apps/examples/postcard/vitest.config.ts
@@ -1,3 +1,4 @@
+import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
const TWENTY_API_URL = process.env.TWENTY_API_URL ?? 'http://localhost:2020';
@@ -12,6 +13,8 @@ process.env.TWENTY_API_KEY = TWENTY_API_KEY;
export default defineConfig({
resolve: {
tsconfigPaths: true,
+ // tsconfig.json excludes the tests, and since vite 8.1 its paths no longer apply to them
+ alias: { src: fileURLToPath(new URL('./src', import.meta.url)) },
},
test: {
testTimeout: 120_000,