Skip to content

Commit 9315faf

Browse files
committed
test(dialog): name component tests *.spec.ts and exclude tests/ct from Vitest
Follow the repo convention (*.spec.ts) for the Playwright component tests and exclude tests/ct/ from Vitest so the two runners do not collide. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent 9ddbc91 commit 9315faf

5 files changed

Lines changed: 6 additions & 4 deletions

File tree

playwright-ct.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import { defineConfig, devices } from '@playwright/experimental-ct-vue'
77

88
export default defineConfig({
9+
// Component tests live under tests/ct/ (excluded from Vitest in
10+
// vitest.config), so Playwright owns this directory.
911
testDir: './tests/ct',
10-
// Component tests are named *.ct.ts so Vitest (which globs *.spec/*.test)
11-
// ignores them and only Playwright picks them up.
12-
testMatch: '**/*.ct.ts',
12+
testMatch: '**/*.spec.ts',
1313
snapshotDir: './tests/ct/__snapshots__',
1414
fullyParallel: true,
1515
use: {

vitest.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import vue from '@vitejs/plugin-vue'
7-
import { defineConfig } from 'vitest/config'
7+
import { configDefaults, defineConfig } from 'vitest/config'
88

99
export default defineConfig({
1010
plugins: [vue()],
@@ -14,6 +14,8 @@ export default defineConfig({
1414
},
1515
test: {
1616
environment: 'happy-dom',
17+
// Playwright component tests live under tests/ct/ and must not be run by Vitest.
18+
exclude: [...configDefaults.exclude, 'tests/ct/**'],
1719
// @nextcloud/vue ships ESM + CSS that must be transformed by Vite in tests.
1820
server: {
1921
deps: {

0 commit comments

Comments
 (0)