api: quiet pino output during test runs
Tests ran at the logger default info level, so pino-http logged every request and most services logged at info, burying the actual results. The db project now defaults to error, and an explicit LOG_LEVEL still overrides it per run
Pedro Lucas Porcellis porcellis@eletrotupi.com · 9 days ago
c377fb94289224023a0ab5d229329b5a4e06af51 Browse filesParents
c121404Changed files
1
Additions
+4
Deletions
0
api/vitest.config.ts
1 1
import { defineConfig } from 'vitest/config'
2 2
import tsconfigPaths from 'vite-tsconfig-paths'
3 3
4 4
// Both projects import source through the same `@app/*` alias the app uses
5 5
const appPaths = () => tsconfigPaths({ projects: ['./tsconfig.test.json'] })
45 45
environment: 'node',
46 46
include: ['tests/**/*.test.ts'],
47 47
exclude: ['**/node_modules/**', 'tests/**/*.unit.test.ts'],
48 48
setupFiles: ['./tests/setup.ts'],
49 49
testTimeout: 15_000,
50 +
// Every request is logged by pino-http and most services log at info,
51 +
// which buries the run output. Errors stay visible; override per-run
52 +
// with LOG_LEVEL=debug (or any level) to see everything.
53 +
env: { LOG_LEVEL: process.env.LOG_LEVEL || 'error' },
50 54
typecheck: {
51 55
tsconfig: './tsconfig.test.json',
52 56
},
53 57
},
54 58
},
55 59
],
56 60
},
57 61
})