Desktop test execution now preserves CI reporter and JSON output flags. - Forward caller-selected Vitest reporters and output files through the desktop test wrapper. - Add coverage for reporter syntax and shard timing command forwarding. - Document desktop timing artifact requirements. Files changed: docs/testing.md | 7 ++++- packages/desktop/scripts/__tests__/test-args.test.ts | 36 ++++++++++++++++++++++ packages/desktop/scripts/test-args.ts | 13 ++++++++ packages/desktop/scripts/test.ts | 3 +- scripts/__tests__/ci-test-shard.test.mjs | 9 ++++++ 5 files changed, 66 insertions(+), 2 deletions(-) Fusion-Task-Id: FN-8560 Fusion-Task-Lineage: 2a89b28d-39f6-4949-aec2-1123c36126cf Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
14 lines
660 B
TypeScript
14 lines
660 B
TypeScript
const REPORTER_FLAG = /^(?:--reporter|-r)(?:=|$)/;
|
|
|
|
/**
|
|
* FNXC:TestInfrastructure 2026-07-24-10:30:
|
|
* CI shard commands append Vitest JSON reporter and package-relative output
|
|
* flags after each package's `test` script. Desktop's wrapper must preserve
|
|
* those caller arguments so its timing data reaches the Full Suite artifact;
|
|
* use dot only for interactive/default invocations that selected no reporter.
|
|
*/
|
|
export function buildDesktopVitestArgs(callerArgs: readonly string[]): string[] {
|
|
const args = ["run", "--silent=passed-only", ...callerArgs];
|
|
return callerArgs.some((arg) => REPORTER_FLAG.test(arg)) ? args : [...args, "--reporter=dot"];
|
|
}
|