From 9e73ed8f47a292cfd778b99ee45cf9a011bec9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Fri, 29 Oct 2021 09:25:47 +0200 Subject: [PATCH] chore: remvoe console.error for tests expecting error --- src/lib/middleware/rbac-middleware.test.ts | 2 ++ src/lib/services/client-metrics/client-metrics-service-v2.ts | 1 - src/test/e2e/stores/feature-toggle-store.e2e.test.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/middleware/rbac-middleware.test.ts b/src/lib/middleware/rbac-middleware.test.ts index d899c1c75a..1f63d26339 100644 --- a/src/lib/middleware/rbac-middleware.test.ts +++ b/src/lib/middleware/rbac-middleware.test.ts @@ -87,6 +87,7 @@ test('should not give api-user ADMIN permission', async () => { }); test('should not allow user to miss userId', async () => { + jest.spyOn(global.console, 'error').mockImplementation(() => jest.fn()); const accessService = { hasPermission: jest.fn(), }; @@ -108,6 +109,7 @@ test('should not allow user to miss userId', async () => { }); test('should return false for missing user', async () => { + jest.spyOn(global.console, 'error').mockImplementation(() => jest.fn()); const accessService = { hasPermission: jest.fn(), }; diff --git a/src/lib/services/client-metrics/client-metrics-service-v2.ts b/src/lib/services/client-metrics/client-metrics-service-v2.ts index f54b7d6d96..25248c49fe 100644 --- a/src/lib/services/client-metrics/client-metrics-service-v2.ts +++ b/src/lib/services/client-metrics/client-metrics-service-v2.ts @@ -32,7 +32,6 @@ export default class ClientMetricsServiceV2 { this.bulkInterval = bulkInterval; this.timer = setInterval(() => { - console.log('Clear metrics'); this.clientMetricsStoreV2.clearMetrics(48); }, ONE_DAY); this.timer.unref(); diff --git a/src/test/e2e/stores/feature-toggle-store.e2e.test.ts b/src/test/e2e/stores/feature-toggle-store.e2e.test.ts index 004efba21c..f07318f676 100644 --- a/src/test/e2e/stores/feature-toggle-store.e2e.test.ts +++ b/src/test/e2e/stores/feature-toggle-store.e2e.test.ts @@ -23,6 +23,7 @@ test('should not crash for unknown toggle', async () => { }); test('should not crash for undefined toggle name', async () => { + jest.spyOn(global.console, 'error').mockImplementation(() => jest.fn()); const project = await featureToggleStore.getProjectId(undefined); expect(project).toBe(undefined); });