-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.js
More file actions
51 lines (42 loc) · 1.2 KB
/
vitest.config.js
File metadata and controls
51 lines (42 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Node.js built-in APIs.
import { globSync as glob } from 'fs'
import path from 'path'
import process from 'process'
// Third-party modules.
import { defineConfig } from 'vitest/config'
import babel from '@rolldown/plugin-babel'
// Local configurations.
import configurateBabel from './babel.config.js'
// Constants.
const ONE_SECOND = 1000
const ONE_MINUTE = 60 * ONE_SECOND
export default defineConfig({
plugins: [
babel({
presets: [ {
preset: () => configurateBabel(),
rolldown: { filter: { moduleType: [ 'ts' ] } },
} ],
}),
],
test: {
coverage: {
enabled: true,
include: [ 'packages/**/*.{js,ts}' ],
exclude: [ '**/externals', '*.d.ts', 'packages/shader-compressor/**/bindings.js' ],
reporter: [ 'lcov' ],
},
include: [ 'tests/**/*.ts', 'sources/**/*.spec.ts' ],
exclude: [ 'tests/(artifacts|examples)/**/*.ts' ],
projects: glob('packages/*')
.map(projectFolder => /** @type {import('vitest/config').TestProjectConfiguration} */ ({
extends: true,
test: {
name: `@cichol/${path.basename(projectFolder)}`,
dir: projectFolder,
},
})),
reporters: [ process.env.GITHUB_ACTIONS ? 'github-actions' : 'default' ],
testTimeout: ONE_MINUTE,
},
})