mirror of
https://github.com/spartan-ng/spartan.git
synced 2026-09-22 16:41:38 +08:00
b296a3613b
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.
26 lines
998 B
TypeScript
26 lines
998 B
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',
|
|
setupFiles: ['src/test-setup.ts'],
|
|
include: ['src/**/*.spec.ts'],
|
|
// The doc/snippet generators under test log progress chatter ("Missing style file", "Snippets
|
|
// generated", ...). The specs assert on generated output, not this logging, so drop it to keep
|
|
// the CI log readable; failures are still reported by the test reporter.
|
|
onConsoleLog: () => false,
|
|
},
|
|
cacheDir: '../../node_modules/.vitest/tools',
|
|
});
|