Repository navigation
Expand file tree
/
Copy pathvitest.webgl.config.ts
More file actions
56 lines (55 loc) · 1.84 KB
/
Copy pathvitest.webgl.config.ts
File metadata and controls
56 lines (55 loc) · 1.84 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
52
53
54
55
56
// Real-renderer tests: Vitest browser mode in headless Chromium, drawing
// through @solidtv/renderer (WebGL, SDF text), not the DOM renderer.
//
// pnpm test:webgl (vitest run --config=vitest.webgl.config.ts)
//
// Needs Playwright's Chromium: `npx playwright install chromium`.
// The default `vitest run` (vitest.config.ts, jsdom) excludes tests/webgl.
import { defineConfig } from 'vitest/config';
import { playwright } from '@vitest/browser-playwright';
import solid from 'vite-plugin-solid';
export default defineConfig({
define: {
// Solid: build without the DOM renderer, as a WebGL app does.
SOLIDTV_DOM_RENDERING: false,
// Renderer build flags (src/common/flags.ts): production build, no
// inspector, no bounds events, as the bench and the demo app build it.
__DEV__: false,
__enableInspector__: false,
__emitBoundsEvents__: false,
__enableCompressedTextures__: false,
},
plugins: [
solid({
hot: false,
solid: {
moduleName: '@solidtv/solid',
generate: 'universal',
builtIns: [],
},
}),
],
test: {
include: ['tests/webgl/**/*.test.tsx'],
watch: false,
browser: {
enabled: true,
headless: true,
// A failure's screenshot of the canvas says nothing the assertion
// does not, and would litter the tree with __screenshots__.
screenshotFailures: false,
// https://vitest.dev/guide/browser/playwright
provider: playwright({
launchOptions: {
// Headless Chromium has no GPU: run WebGL on SwiftShader.
args: ['--use-angle=swiftshader', '--enable-unsafe-swiftshader'],
},
}),
instances: [{ browser: 'chromium' }],
},
},
resolve: {
conditions: ['@solidtv/source', 'browser', 'development'],
dedupe: ['solid-js', 'solid-js/universal', 'solid-js/store'],
},
});