Files
advanced-camera-card/vite.config.ts
T

59 lines
1.3 KiB
TypeScript

import { defineConfig } from 'vitest/config';
import { svgPath } from './scripts/svg-path-plugin.js';
const EXCLUSIONS = [
'.eslintrc.cjs',
'docs/**',
'tests/**',
// Web-components.
'src/card.ts',
'src/components/**/*.ts',
'src/editor.ts',
// Timeline controller (can be added later).
'src/components-lib/timeline/controller.ts',
// HA patches.
'src/patches/**/*.ts',
];
const INCLUSIONS = ['tests/**/*.test.ts'];
// ts-prune-ignore-next
export default defineConfig({
plugins: [svgPath()],
test: {
server: {
deps: {
// These dependencies import without extensions.
// Related: https://github.com/vitest-dev/vitest/issues/2313
inline: ['ha-nunjucks', 'ts-py-datetime'],
},
},
include: INCLUSIONS,
// Hide console writing to keep output clean, usual sources of noise:
// - Unnecessary Lit dev-mode warnings.
// - Various console outputs (that are expected/tested).
onConsoleLog: () => false,
coverage: {
exclude: EXCLUSIONS,
// Favor istanbul for coverage over v8 due to better accuracy.
provider: 'istanbul',
thresholds: {
perFile: true,
'src/**/*.ts': {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
},
},
});