diff --git a/packages/vitest-angular/src/lib/builders/test/schema.d.ts b/packages/vitest-angular/src/lib/builders/test/schema.d.ts index 9b8062140..1cdd3d006 100644 --- a/packages/vitest-angular/src/lib/builders/test/schema.d.ts +++ b/packages/vitest-angular/src/lib/builders/test/schema.d.ts @@ -4,4 +4,6 @@ export interface VitestSchema { reportsDirectory?: string; testFiles?: string[]; watch?: boolean; + ui?: boolean; + coverage?: boolean; } diff --git a/packages/vitest-angular/src/lib/builders/test/schema.json b/packages/vitest-angular/src/lib/builders/test/schema.json index 95a643bb9..2a7877312 100644 --- a/packages/vitest-angular/src/lib/builders/test/schema.json +++ b/packages/vitest-angular/src/lib/builders/test/schema.json @@ -28,6 +28,14 @@ "watch": { "description": "Watch files for changes and rerun tests related to changed files.", "type": "boolean" + }, + "ui": { + "description": "Run tests using Vitest UI Mode.", + "type": "boolean" + }, + "coverage": { + "description": "Enable code coverage analysis.", + "type": "boolean" } }, "required": [] diff --git a/packages/vitest-angular/src/lib/builders/test/vitest.impl.ts b/packages/vitest-angular/src/lib/builders/test/vitest.impl.ts index e12df71a3..46c56008e 100644 --- a/packages/vitest-angular/src/lib/builders/test/vitest.impl.ts +++ b/packages/vitest-angular/src/lib/builders/test/vitest.impl.ts @@ -20,12 +20,19 @@ async function vitestBuilder( const projectConfig = await context.getProjectMetadata( context.target as unknown as string ); - const extraArgs = await getExtraArgs(options); + const { coverageArgs, ...extraArgs } = await getExtraArgs(options); const watch = options.watch === true; + const ui = options.ui === true; + const coverageEnabled = options.coverage === true; const config = { root: `${projectConfig['root'] || '.'}`, watch, + ui, config: options.configFile, + coverage: { + enabled: coverageEnabled, + ...coverageArgs, + }, ...extraArgs, };