Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

vitest.zoneful.config.ts

36 lines1.2 KB

1import { defineConfig, mergeConfig } from 'vitest/config'
2import baseConfig from './vitest.config'
3​
4/**
5 * Runs the Angular tests with Zone.js enabled. Tests use the change-detection
6 * provider from test-utils, which selects provideZoneChangeDetection here and
7 * provideZonelessChangeDetection in the default runner.
8 */
9const config = mergeConfig(
10 baseConfig,
11 defineConfig({
12 test: {
13 setupFiles: ['./test-setup.zoneful.ts'],
14 coverage: { reportsDirectory: './coverage/zoneful' },
15 typecheck: { enabled: false },
16 },
17 }),
19​
20// The base project excludes the Zone.js-only integration file so an ordinary
21// run remains genuinely zoneless. The Zone.js project explicitly opts it in.
22if (config.test) {
23 // Replace, rather than merge with, the base setup so Zone.js is installed
24 // before Angular initializes its browser testing environment.
25 config.test.setupFiles = ['./test-setup.zoneful.ts']
26 config.test.include = [
27 '**/zoneful-integration.test.ts',
28 '**/pending-tasks.test.ts',
29 '**/pending-tasks-ssr.zoneful.test.ts',
30 '**/upstream-issues.test.ts',
31 '**/inject-external-store.test.ts',
32 ]
33 config.test.exclude = []
35​
36export default config