chore(services): 🔧 Update Vitest & TypeScript configs across services to standardize test plugins, paths, and strictness settings
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
64632b1bb5
commit
febc3fc1df
5 changed files with 219 additions and 8 deletions
70
services/api/vitest.config.ts
Normal file
70
services/api/vitest.config.ts
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
import swc from 'unplugin-swc';
|
||||||
|
import path from 'path';
|
||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
swc.vite({
|
||||||
|
module: { type: 'es6' },
|
||||||
|
jsc: {
|
||||||
|
parser: {
|
||||||
|
syntax: 'typescript',
|
||||||
|
decorators: true,
|
||||||
|
},
|
||||||
|
transform: {
|
||||||
|
legacyDecorator: true,
|
||||||
|
decoratorMetadata: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
test: {
|
||||||
|
globals: true,
|
||||||
|
environment: 'node',
|
||||||
|
testTimeout: 30000,
|
||||||
|
include: ['src/**/*.spec.ts', 'test/**/*.spec.ts'],
|
||||||
|
exclude: ['**/*.e2e-spec.ts', 'node_modules', 'dist'],
|
||||||
|
setupFiles: ['./test/setup.ts'],
|
||||||
|
coverage: {
|
||||||
|
provider: 'v8',
|
||||||
|
reporter: ['text', 'json', 'html'],
|
||||||
|
include: [
|
||||||
|
'src/acquisition/**/*.service.ts',
|
||||||
|
'src/engagement/**/*.service.ts',
|
||||||
|
'src/audience/**/*.service.ts',
|
||||||
|
'src/sessions/**/*.service.ts',
|
||||||
|
'src/segments/**/*.service.ts',
|
||||||
|
'src/trends/**/*.service.ts',
|
||||||
|
'src/funnels/**/*.service.ts',
|
||||||
|
'src/cohorts/**/*.service.ts',
|
||||||
|
],
|
||||||
|
exclude: [
|
||||||
|
'node_modules/',
|
||||||
|
'dist/',
|
||||||
|
'**/*.spec.ts',
|
||||||
|
'**/*.e2e-spec.ts',
|
||||||
|
'**/main.ts',
|
||||||
|
'**/index.ts',
|
||||||
|
'**/*.dto.ts',
|
||||||
|
'**/*.module.ts',
|
||||||
|
'**/*.controller.ts',
|
||||||
|
'**/*.entity.ts',
|
||||||
|
'test/**',
|
||||||
|
'vitest*.config.ts',
|
||||||
|
'scripts/**',
|
||||||
|
],
|
||||||
|
thresholds: {
|
||||||
|
statements: 80,
|
||||||
|
branches: 80,
|
||||||
|
functions: 80,
|
||||||
|
lines: 80,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': path.resolve(__dirname, './src'),
|
||||||
|
'@test': path.resolve(__dirname, './test'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
51
services/collector/vitest.config.ts
Normal file
51
services/collector/vitest.config.ts
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
import path from 'path';
|
||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [],
|
||||||
|
esbuild: {
|
||||||
|
target: 'es2022',
|
||||||
|
},
|
||||||
|
test: {
|
||||||
|
globals: true,
|
||||||
|
environment: 'node',
|
||||||
|
testTimeout: 30000,
|
||||||
|
include: ['src/**/*.spec.ts', 'test/**/*.spec.ts'],
|
||||||
|
exclude: ['**/*.e2e-spec.ts', 'node_modules', 'dist'],
|
||||||
|
setupFiles: ['./test/setup.ts'],
|
||||||
|
coverage: {
|
||||||
|
provider: 'v8',
|
||||||
|
reporter: ['text', 'json', 'html'],
|
||||||
|
include: [
|
||||||
|
'src/tracking/**/*.service.ts',
|
||||||
|
],
|
||||||
|
exclude: [
|
||||||
|
'node_modules/',
|
||||||
|
'dist/',
|
||||||
|
'**/*.spec.ts',
|
||||||
|
'**/*.e2e-spec.ts',
|
||||||
|
'**/main.ts',
|
||||||
|
'**/index.ts',
|
||||||
|
'**/*.dto.ts',
|
||||||
|
'**/*.module.ts',
|
||||||
|
'**/*.controller.ts',
|
||||||
|
'**/*.entity.ts',
|
||||||
|
'test/**',
|
||||||
|
'vitest*.config.ts',
|
||||||
|
'scripts/**',
|
||||||
|
],
|
||||||
|
thresholds: {
|
||||||
|
statements: 80,
|
||||||
|
branches: 80,
|
||||||
|
functions: 80,
|
||||||
|
lines: 80,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': path.resolve(__dirname, './src'),
|
||||||
|
'@test': path.resolve(__dirname, './test'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
36
services/processor/vitest.config.ts
Normal file
36
services/processor/vitest.config.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
import { resolve } from 'path';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
globals: true,
|
||||||
|
environment: 'node',
|
||||||
|
setupFiles: [resolve(__dirname, './test/setup.ts')],
|
||||||
|
coverage: {
|
||||||
|
provider: 'v8',
|
||||||
|
reporter: ['text', 'json', 'html'],
|
||||||
|
exclude: [
|
||||||
|
'node_modules/**',
|
||||||
|
'dist/**',
|
||||||
|
'**/*.spec.ts',
|
||||||
|
'**/*.test.ts',
|
||||||
|
'**/test/**',
|
||||||
|
'scripts/**',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
include: ['src/**/*.spec.ts', 'src/**/*.test.ts'],
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': resolve(__dirname, './src'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
esbuild: {
|
||||||
|
tsconfigRaw: {
|
||||||
|
compilerOptions: {
|
||||||
|
experimentalDecorators: true,
|
||||||
|
emitDecoratorMetadata: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
62
services/realtime/vitest.config.ts
Normal file
62
services/realtime/vitest.config.ts
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
import swc from 'unplugin-swc';
|
||||||
|
import path from 'path';
|
||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
swc.vite({
|
||||||
|
module: { type: 'es6' },
|
||||||
|
jsc: {
|
||||||
|
parser: {
|
||||||
|
syntax: 'typescript',
|
||||||
|
decorators: true,
|
||||||
|
},
|
||||||
|
transform: {
|
||||||
|
legacyDecorator: true,
|
||||||
|
decoratorMetadata: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
test: {
|
||||||
|
globals: true,
|
||||||
|
environment: 'node',
|
||||||
|
testTimeout: 30000,
|
||||||
|
include: ['src/**/*.spec.ts', 'test/**/*.spec.ts'],
|
||||||
|
exclude: ['**/*.e2e-spec.ts', 'node_modules', 'dist'],
|
||||||
|
coverage: {
|
||||||
|
provider: 'v8',
|
||||||
|
reporter: ['text', 'json', 'html'],
|
||||||
|
include: [
|
||||||
|
'src/metrics/**/*.service.ts',
|
||||||
|
'src/gateway/**/*.gateway.ts',
|
||||||
|
],
|
||||||
|
exclude: [
|
||||||
|
'node_modules/',
|
||||||
|
'dist/',
|
||||||
|
'**/*.spec.ts',
|
||||||
|
'**/*.e2e-spec.ts',
|
||||||
|
'**/main.ts',
|
||||||
|
'**/index.ts',
|
||||||
|
'**/*.dto.ts',
|
||||||
|
'**/*.module.ts',
|
||||||
|
'**/*.controller.ts',
|
||||||
|
'**/*.entity.ts',
|
||||||
|
'test/**',
|
||||||
|
'vitest*.config.ts',
|
||||||
|
'scripts/**',
|
||||||
|
],
|
||||||
|
thresholds: {
|
||||||
|
statements: 80,
|
||||||
|
branches: 80,
|
||||||
|
functions: 80,
|
||||||
|
lines: 80,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': path.resolve(__dirname, './src'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "./tsconfig.base.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"rootDir": "src",
|
|
||||||
"outDir": "dist"
|
|
||||||
},
|
|
||||||
"include": ["src/**/*"]
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue