From 9e61cacd16c045c36b3f16d66163618fcde275c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 8 Oct 2017 15:56:42 +0200 Subject: [PATCH] tests: found the unhandled promise issue in the dash import tests --- .../app/features/dashboard/specs/dash_import_ctrl_specs.ts | 6 ++++-- public/test/index.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/app/features/dashboard/specs/dash_import_ctrl_specs.ts b/public/app/features/dashboard/specs/dash_import_ctrl_specs.ts index 97983d60dc9..c541aca34b2 100644 --- a/public/app/features/dashboard/specs/dash_import_ctrl_specs.ts +++ b/public/app/features/dashboard/specs/dash_import_ctrl_specs.ts @@ -53,9 +53,10 @@ describe('DashImportCtrl', function() { // setup api mock backendSrv.get = sinon.spy(() => { return Promise.resolve({ + json: {} }); }); - ctx.ctrl.checkGnetDashboard(); + return ctx.ctrl.checkGnetDashboard(); }); it('should call gnet api with correct dashboard id', function() { @@ -69,9 +70,10 @@ describe('DashImportCtrl', function() { // setup api mock backendSrv.get = sinon.spy(() => { return Promise.resolve({ + json: {} }); }); - ctx.ctrl.checkGnetDashboard(); + return ctx.ctrl.checkGnetDashboard(); }); it('should call gnet api with correct dashboard id', function() { diff --git a/public/test/index.ts b/public/test/index.ts index 79c911cd32c..33f24331b67 100644 --- a/public/test/index.ts +++ b/public/test/index.ts @@ -21,7 +21,7 @@ angular.module('grafana.directives', []); angular.module('grafana.filters', []); angular.module('grafana.routes', ['ngRoute']); -const context = (require).context('../', true, /specs/); +const context = (require).context('../', true, /specs\.(tsx?|js)/); for (let key of context.keys()) { context(key); }