mirror of
https://github.com/immich-app/immich.git
synced 2026-03-05 16:33:46 -05:00
Add `name` to all vitest configs matching CI job buckets (server:unit, server:medium, cli:unit, web:unit, e2e:server, e2e:maintenance) so they appear as filterable @tags in the Vitest VSCode extension. Fix `root` in server vitest configs to use an absolute path derived from `import.meta.url` instead of `'./'`, which resolved relative to the config file directory (`server/test/`) rather than `server/`, causing test discovery to fail in the Vitest VSCode extension.
24 lines
614 B
JavaScript
24 lines
614 B
JavaScript
import { dirname, resolve } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import swc from 'unplugin-swc';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
const serverRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
name: 'server:medium',
|
|
root: serverRoot,
|
|
globals: true,
|
|
include: ['test/medium/**/*.spec.ts'],
|
|
globalSetup: ['test/medium/globalSetup.ts'],
|
|
server: {
|
|
deps: {
|
|
fallbackCJS: true,
|
|
},
|
|
},
|
|
},
|
|
plugins: [swc.vite(), tsconfigPaths()],
|
|
});
|