mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-19 07:36:52 +00:00
3923f1978f
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { coverageConfigDefaults, defineConfig } from 'vitest/config';
|
|
import type { InlineConfig } from 'vitest/node';
|
|
|
|
import { coverageExcludes } from './coverage-excludes.js';
|
|
|
|
/**
|
|
* Shared test options without the outer defineConfig wrapper.
|
|
* Use this when you need to spread the config into workspace projects.
|
|
*/
|
|
export const createBaseInlineConfig = (options: InlineConfig = {}): InlineConfig => ({
|
|
silent: true,
|
|
globals: true,
|
|
environment: 'node',
|
|
reporters: process.env.CI === 'true' ? ['default', 'junit'] : ['default'],
|
|
outputFile: { junit: './junit.xml' },
|
|
...(process.env.COVERAGE_ENABLED === 'true'
|
|
? {
|
|
coverage: {
|
|
enabled: true,
|
|
provider: 'v8',
|
|
reporter: process.env.CI === 'true' ? 'lcov' : 'text-summary',
|
|
include: ['src/**/*.ts'],
|
|
exclude: [...coverageConfigDefaults.exclude, ...coverageExcludes],
|
|
},
|
|
}
|
|
: {}),
|
|
...options,
|
|
});
|
|
|
|
export const createVitestConfig = (options: InlineConfig = {}) =>
|
|
defineConfig({ test: createBaseInlineConfig(options) });
|
|
|
|
export const vitestConfig = createVitestConfig();
|