trilium/vitest.config.ts
Elian Doran fc7b6a6846
ci: follow vitest 5's project uniqueness and blob report path
Two breakages that the typecheck failure was hiding, since every step after it
in the "Test development" job was skipped and the CKEditor job never got as far
as uploading anything.

The root config globs both `packages/*/vitest.config.ts` and
`packages/*/vite.config.ts`. ckeditor5 is the only package with both, and its
vite.config.ts merely builds the library — it declares no tests at all. Vitest 4
registered it anyway as a second project sharing the package's name; vitest 5
rejects the duplicate outright and `pnpm scripts:test` cannot start:

    Error: Project name "@triliumnext/ckeditor5" from
    "packages/ckeditor5/vitest.config.ts" is not unique.

Blob reports also moved from `.vitest-reports/` to `.vitest/blob/`, alongside
the attachments that moved to `.vitest/`. The shard jobs were writing them where
nothing looked, so the upload failed with "No files were found" — after the
tests themselves had passed. The merge job reads the same path and would have
failed next.

Verified by running what CI runs: both shards, then `--mergeReports --coverage`,
which replays 127 files / 1626 tests and clears the gate at
99.91/99.54/100/99.98.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 23:31:58 +02:00

19 lines
628 B
TypeScript

import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
projects: [
"packages/*/vitest.config.ts",
"packages/*/vite.config.ts",
// ckeditor5 is the one package with both, and its vite.config.ts only builds the library —
// the tests live in vitest.config.ts. Registering both gives two projects called
// "@triliumnext/ckeditor5", which vitest rejects.
"!packages/ckeditor5/vite.config.ts",
"apps/*/vitest.config.ts",
"apps/*/vite.config.ts",
"apps/*/vite.config.mts",
"scripts/vitest.config.ts",
],
},
})