Skip to content

Commit

Permalink
chore(vitest): cleanup config
Browse files Browse the repository at this point in the history
  • Loading branch information
RealShadowNova committed Apr 28, 2024
1 parent 7f9e93f commit 8e1eb8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
8 changes: 2 additions & 6 deletions scripts/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import type { ESBuildOptions } from 'vite';
import { defineConfig, UserConfig } from 'vitest/config';
import { UserConfig, configDefaults, defineConfig } from 'vitest/config';

export const createVitestConfig = (options: UserConfig = {}) =>
defineConfig({
...options,
test: {
...options?.test,
deps: {
inline: [/^(?!.*vitest).*$/]
},
globals: true,
coverage: {
...options.test?.coverage,
enabled: true,
reporter: ['text', 'lcov', 'clover'],
exclude: [...(options.test?.coverage?.exclude ?? []), '**/node_modules/**', '**/dist/**', '**/tests/**']
exclude: [...(options.test?.coverage?.exclude ?? []), ...configDefaults.exclude, '**/tests/**', '**/.yarn/**', '**/scripts/**']
}
},
esbuild: {
Expand Down
5 changes: 0 additions & 5 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { createVitestConfig } from './scripts/vitest.config';

export default createVitestConfig({
test: {
deps: {
inline: [/^(?!.*vitest).*$/]
}
},
esbuild: {
target: 'es2022'
}
Expand Down

0 comments on commit 8e1eb8c

Please sign in to comment.