From ea8aa29b8c90df9b280793e7970687a7dbb029c0 Mon Sep 17 00:00:00 2001 From: Jonathan Kolberg Date: Tue, 20 Sep 2022 20:25:58 +0200 Subject: [PATCH] demonstration of the bug with the coverage for products:test --- apps/products/project.json | 3 ++- apps/products/src/app/app.component.ts | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/products/project.json b/apps/products/project.json index 4dfd2946..33eb5437 100644 --- a/apps/products/project.json +++ b/apps/products/project.json @@ -100,7 +100,8 @@ "executor": "@nrwl/jest:jest", "options": { "jestConfig": "apps/products/jest.config.ts", - "passWithNoTests": true + "passWithNoTests": true, + "coverage": true }, "outputs": ["coverage/apps/products"] }, diff --git a/apps/products/src/app/app.component.ts b/apps/products/src/app/app.component.ts index ff3c08d3..4638807f 100644 --- a/apps/products/src/app/app.component.ts +++ b/apps/products/src/app/app.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; +import { Router } from '@angular/router'; import '@nx-example/shared/header'; @@ -7,4 +8,8 @@ import '@nx-example/shared/header'; templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], }) -export class AppComponent {} +export class AppComponent { + constructor(router: Router) { + console.log(router.url) + } +}