-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathvitest.config.base.ts
More file actions
39 lines (36 loc) · 1018 Bytes
/
vitest.config.base.ts
File metadata and controls
39 lines (36 loc) · 1018 Bytes
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
import {defineConfig} from 'vitest/config';
import {createFilter} from '@rollup/pluginutils';
import arraybuffer from 'vite-plugin-arraybuffer';
import {playwright} from '@vitest/browser-playwright';
const isCI = process.env.CI === 'true';
function glsl(include: string[]) {
const filter = createFilter(include);
return {
name: 'glsl',
transform(code, id) {
if (!filter(id)) return;
return {
code: `export default ${JSON.stringify(code)};`
};
}
};
}
export default defineConfig({
test: {
retry: isCI ? 2 : 0,
testTimeout: 5_000,
browser: {
provider: playwright(),
enabled: true,
headless: true,
fileParallelism: false,
screenshotFailures: false,
},
restoreMocks: true,
unstubGlobals: true,
},
plugins: [
glsl(['./src/shaders/*.glsl', './3d-style/shaders/*.glsl']),
arraybuffer(),
],
});