123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
- const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**"];
- const defaultCoverageExcludes = [
- "coverage/**",
- "dist/**",
- "packages/*/test{,s}/**",
- "**/*.d.ts",
- "cypress/**",
- "test{,s}/**",
- "test{,-*}.{js,cjs,mjs,ts,tsx,jsx}",
- "**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}",
- "**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}",
- "**/__tests__/**",
- "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.{js,cjs,mjs,ts}",
- "**/.{eslint,mocha,prettier}rc.{js,cjs,yml}"
- ];
- const coverageConfigDefaults = {
- provider: "c8",
- enabled: false,
- clean: true,
- cleanOnRerun: false,
- reportsDirectory: "./coverage",
- excludeNodeModules: true,
- exclude: defaultCoverageExcludes,
- reporter: ["text", "html", "clover", "json"],
- allowExternal: false,
- extension: [".js", ".cjs", ".mjs", ".ts", ".tsx", ".jsx", ".vue", ".svelte"]
- };
- const fakeTimersDefaults = {
- loopLimit: 1e4,
- shouldClearNativeTimers: true,
- toFake: [
- "setTimeout",
- "clearTimeout",
- "setInterval",
- "clearInterval",
- "setImmediate",
- "clearImmediate",
- "Date"
- ]
- };
- const config = {
- allowOnly: !process.env.CI,
- watch: !process.env.CI,
- globals: false,
- environment: "node",
- threads: true,
- clearMocks: false,
- restoreMocks: false,
- mockReset: false,
- include: defaultInclude,
- exclude: defaultExclude,
- testTimeout: 5e3,
- hookTimeout: 1e4,
- teardownTimeout: 1e3,
- isolate: true,
- watchExclude: ["**/node_modules/**", "**/dist/**"],
- forceRerunTriggers: [
- "**/package.json/**",
- "**/vitest.config.*/**",
- "**/vite.config.*/**"
- ],
- update: false,
- reporters: [],
- silent: false,
- api: false,
- ui: false,
- uiBase: "/__vitest__/",
- open: true,
- css: {
- include: []
- },
- coverage: coverageConfigDefaults,
- fakeTimers: fakeTimersDefaults,
- maxConcurrency: 5,
- dangerouslyIgnoreUnhandledErrors: false
- };
- const configDefaults = Object.freeze(config);
- function defineConfig(config) {
- return config;
- }
- export { configDefaults, defaultExclude, defaultInclude, defineConfig };
|