Skip to content

Commit 8a1921a

Browse files
committed
Add Unit tests #638 fix github actions
1 parent f26503c commit 8a1921a

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

web-client/playwright.config.mts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// playwright.config.mts
12
import path from 'path';
23
import { fileURLToPath } from 'url';
34
import { defineConfig, devices } from '@playwright/test';
@@ -6,7 +7,7 @@ import * as dotenv from 'dotenv';
67

78
const __filename = fileURLToPath(import.meta.url);
89
const __dirname = path.dirname(__filename);
9-
const ROOT = path.resolve(__dirname, '..'); // repo root
10+
const ROOT = path.resolve(__dirname, '..');
1011

1112
const env = process.env.ENV || 'local';
1213
const envPath = path.join(ROOT, `.env.${env}`);
@@ -18,8 +19,12 @@ if (fs.existsSync(envPath)) {
1819
}
1920

2021
export default defineConfig({
21-
// Your tests live at repo root under tests/e2e
22-
testDir: path.resolve(__dirname, 'tests'),
22+
// Only look under tests/e2e
23+
testDir: path.resolve(__dirname, 'tests/e2e'),
24+
testMatch: /.*\.e2e\.(spec|test)\.(ts|js|mjs|cjs)$/,
25+
26+
// Belt & suspenders: if someone moves things around, still ignore unit
27+
testIgnore: ['**/unit/**', '**/*.vitest.*'],
2328

2429
reporter: [['html', { outputFolder: path.resolve(__dirname, 'playwright-report'), open: 'never' }]],
2530
fullyParallel: true,
@@ -37,12 +42,11 @@ export default defineConfig({
3742
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
3843
],
3944

40-
webServer: {
41-
// build at repo root (Makefile), then preview inside web-client
42-
command: 'make -s build && npm --prefix web-client run preview -- --port=5173 --strictPort',
43-
port: 5173,
44-
reuseExistingServer: !process.env.CI,
45-
cwd: ROOT, // repo root (Makefile lives here)
46-
timeout: 120_000,
47-
}
45+
webServer: {
46+
command: 'make -s build && npm --prefix web-client run preview -- --port=5173 --strictPort',
47+
port: 5173,
48+
reuseExistingServer: !process.env.CI,
49+
cwd: ROOT,
50+
timeout: 120_000,
51+
},
4852
});

0 commit comments

Comments
 (0)