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

vitest.zoneful.config.ts

34 lines1.1 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 },
15 }),
17​
18// The base project excludes the Zone.js-only integration file so an ordinary
19// run remains genuinely zoneless. The Zone.js project explicitly opts it in.
20if (config.test) {
21 // Replace, rather than merge with, the base setup so Zone.js is installed
22 // before Angular initializes its browser testing environment.
23 config.test.setupFiles = ['./test-setup.zoneful.ts']
24 config.test.include = [
25 '**/zoneful-integration.test.ts',
26 '**/pending-tasks.test.ts',
27 '**/pending-tasks-ssr.zoneful.test.ts',
28 '**/upstream-issues.test.ts',
29 '**/inject-external-store.test.ts',
30 ]
31 config.test.exclude = []
33​
34export default config