Files
spartan-ng__spartan/libs/cli/vite.config.mts
Ashley Hunter b296a3613b test: silence nx-generator console noise in cli and tools specs
The cli generator specs drive real nx generators, which log copiously
("Couldn't find .gitignore", "NX workspace root does not exist", etc.) - ~3k
lines across 142 specs, enough to truncate the CI log and bury the run summary,
making a passing suite look like it failed. tools has the same class of chatter.

Add `onConsoleLog: () => false` to both configs so that intercepted console
output is dropped (the specs assert on the generated tree and on console spies,
not on this logging; test failures are still reported by the reporter). cli's
output drops from ~3160 to ~530 lines and the summary is visible again.
2026-06-13 19:15:39 +01:00

29 lines
1.2 KiB
TypeScript

/// <reference types="vitest" />
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
root: __dirname,
// `nxViteTsPaths` resolves the `@spartan-ng/*` workspace aliases (tsconfig.base paths) to source.
plugins: [nxViteTsPaths()],
test: {
globals: true,
// Emit the default summary so CI logs show the test counts; a terse reporter previously let
// a project's specs go silently undiscovered.
reporters: ['default'],
environment: 'node',
include: ['src/**/*.spec.ts'],
// These specs run the real nx application/library generators against an in-memory tree, which
// is heavy; give them headroom beyond the 5s default.
testTimeout: 30_000,
// The nx generators under test log copiously to stdout/stderr ("Couldn't find .gitignore",
// "NX workspace root does not exist", etc.). Across 142 specs that floods (and truncates) the
// CI log and buries the run summary. The specs assert on the tree and on console spies, not on
// this output, so drop it - failures are still reported by the test reporter.
onConsoleLog: () => false,
},
cacheDir: '../../node_modules/.vitest/cli',
});