(
name: string,
directory: string,
include: boolean = true,
config: ViteUserConfig = {}
)
| 20 | // Use `test.dir` to share the root Vite server and transform cache. |
| 21 | // Projects that override Vite options get their own server. |
| 22 | const project = ( |
| 23 | name: string, |
| 24 | directory: string, |
| 25 | include: boolean = true, |
| 26 | config: ViteUserConfig = {} |
| 27 | ) => { |
| 28 | if (!include) { |
| 29 | return [] |
| 30 | } |
| 31 | |
| 32 | const merged = mergeConfig({ |
| 33 | test: { |
| 34 | name, |
| 35 | dir: path.join(import.meta.dirname, directory) |
| 36 | } |
| 37 | }, config) |
| 38 | // Apply defaults here because mergeConfig concatenates arrays. |
| 39 | merged.test!.include ??= ["test/**/*.test.{ts,tsx}"] |
| 40 | merged.test!.exclude ??= [...exclude] |
| 41 | return [merged] |
| 42 | } |
| 43 | |
| 44 | export const exclude = [ |
| 45 | "**/.*/**", |
no test coverage detected