Skip to content

Commit

Permalink
update vitest setup, and collect coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Jun 10, 2024
1 parent 8506380 commit b586dad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
30 changes: 30 additions & 0 deletions packages/@n8n/chat/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { resolve } from 'path';
import { mergeConfig } from 'vite';
import { type UserConfig } from 'vitest';
import { defineConfig } from 'vitest/config';
import viteConfig from './vite.config.mts';

const srcPath = resolve(__dirname, 'src');
const vitestConfig = defineConfig({
test: {
globals: true,
environment: 'jsdom',
root: srcPath,
setupFiles: ['./src/__tests__/setup.ts'],
...(process.env.COVERAGE_ENABLED === 'true'
? {
coverage: {
enabled: true,
provider: 'v8',
reporter: process.env.CI === 'true' ? 'cobertura' : 'text-summary',
all: true,
},
}
: {}),
},
}) as UserConfig;

export default mergeConfig(
viteConfig,
vitestConfig,
);
20 changes: 0 additions & 20 deletions packages/@n8n/chat/vitest.config.ts

This file was deleted.

0 comments on commit b586dad

Please sign in to comment.