Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: adjust vitest for vitest v3
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Feb 21, 2025
commit a732367115cd6490e7ff5366687cd044ffb6fe2e
38 changes: 18 additions & 20 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,23 @@ import type { UserConfig } from 'vitest/node'
import config from './vite.config.ts'

export default async (env) => {
const cfg = await config(env)
// Node externals does not work with vitest
cfg.plugins = cfg.plugins!.filter((plugin) => plugin && 'name' in plugin && plugin.name !== 'node-externals')

cfg.test = {
environment: 'jsdom',
environmentOptions: {
jsdom: {
url: 'https://cloud.example.com/index.php/apps/test',
return {
...await config(env),
test: {
environment: 'jsdom',
environmentOptions: {
jsdom: {
url: 'https://cloud.example.com/index.php/apps/test',
},
},
setupFiles: '__tests__/setup.ts',
coverage: {
include: ['lib/**'],
// This makes no sense to test
exclude: ['lib/utils/l10n.ts'],
reporter: ['lcov', 'text'],
},
},
setupFiles: '__tests__/setup.ts',
coverage: {
include: ['lib/**'],
// This makes no sense to test
exclude: ['lib/utils/l10n.ts'],
reporter: ['lcov', 'text'],
},
pool: 'vmForks',
} as UserConfig
return cfg
pool: 'vmForks',
} as UserConfig,
}
}