mirror of
https://github.com/immich-app/immich.git
synced 2026-03-05 08:23:45 -05:00
chore: add vitest project names and fix server config root paths (#26684)
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.
This commit is contained in:
parent
f94e0fbc39
commit
54bc9ddd69
@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
name: 'cli:unit',
|
||||
globals: true,
|
||||
},
|
||||
});
|
||||
|
||||
@ -14,6 +14,7 @@ if (!skipDockerSetup) {
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
name: 'e2e:server',
|
||||
retry: process.env.CI ? 4 : 0,
|
||||
include: ['src/specs/server/**/*.e2e-spec.ts'],
|
||||
globalSetup,
|
||||
|
||||
@ -14,6 +14,7 @@ if (!skipDockerSetup) {
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
name: 'e2e:maintenance',
|
||||
retry: process.env.CI ? 4 : 0,
|
||||
include: ['src/specs/maintenance/server/**/*.e2e-spec.ts'],
|
||||
globalSetup,
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
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: {
|
||||
root: './',
|
||||
name: 'server:medium',
|
||||
root: serverRoot,
|
||||
globals: true,
|
||||
include: ['test/medium/**/*.spec.ts'],
|
||||
globalSetup: ['test/medium/globalSetup.ts'],
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
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: {
|
||||
root: './',
|
||||
name: 'server:unit',
|
||||
root: serverRoot,
|
||||
globals: true,
|
||||
include: ['src/**/*.spec.ts'],
|
||||
coverage: {
|
||||
|
||||
@ -56,6 +56,7 @@ export default defineConfig({
|
||||
entries: ['src/**/*.{svelte,ts,html}'],
|
||||
},
|
||||
test: {
|
||||
name: 'web:unit',
|
||||
include: ['src/**/*.{test,spec}.{js,ts}'],
|
||||
globals: true,
|
||||
environment: 'happy-dom',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user