From 387b2f34fdf194eeba91588679d0822b23e8e6e5 Mon Sep 17 00:00:00 2001 From: mgechev Date: Wed, 11 Mar 2020 16:26:13 -0700 Subject: [PATCH] refactor(devtools): show more meaningful warning message to help us debug cases --- package.json | 3 ++- projects/ng-devtools-backend/src/lib/observer/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e43c9067a9a..d669f662232 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "cy:run:watch": "ng serve & wait-on http://localhost:4200 && $(npm bin)/cypress open", "test:backend": "ng test ng-devtools-backend --watch=false", "test:devtools": "ng test ng-devtools --watch=false", - "test:ci": "npm run test:backend && npm run test:devtools", + "test:shared-utils": "ng test shared-utils --watch=false", + "test:ci": "npm run test:backend && npm run test:devtools && npm run test:shared-utils", "prettier": "prettier --write \"{,!(node_modules|dist|build|coverage)/**/}*.{js,jsx,ts,tsx,json}\"", "prettier:fix": "pretty-quick --staged" }, diff --git a/projects/ng-devtools-backend/src/lib/observer/index.ts b/projects/ng-devtools-backend/src/lib/observer/index.ts index 2f605ff591c..f38ef820a3a 100644 --- a/projects/ng-devtools-backend/src/lib/observer/index.ts +++ b/projects/ng-devtools-backend/src/lib/observer/index.ts @@ -123,7 +123,7 @@ const insertElementProfile = (frames: ElementProfile[], position: ElementPositio const pos = position[i]; if (!frames[pos]) { // TODO(mgechev): consider how to ensure we don't hit this case - console.warn('Unable to find parent node for', original); + console.warn('Unable to find parent node for', profile, original); return; } frames = frames[pos].children; @@ -149,7 +149,7 @@ const insertElementProfileAtEnd = (frames: ElementProfile[], position: ElementPo const pos = position[i]; if (!frames[pos]) { // TODO(mgechev): consider how to ensure we don't hit this case - console.warn('Unable to find parent node for', frames); + console.warn('Unable to find parent node for', profile); return; } frames = frames[pos].children;