From bf0ebd2159061da5ebb83f50f5ed109f943bba58 Mon Sep 17 00:00:00 2001
From: Hasan Awad <90554456+hasanwhitesource@users.noreply.github.com>
Date: Thu, 10 Feb 2022 17:21:05 +0200
Subject: [PATCH] test: fix broken test of 'processBranch' function (#14135)

---
 lib/workers/branch/index.spec.ts | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/lib/workers/branch/index.spec.ts b/lib/workers/branch/index.spec.ts
index 2b278e6f58..ca83c4e0bb 100644
--- a/lib/workers/branch/index.spec.ts
+++ b/lib/workers/branch/index.spec.ts
@@ -132,22 +132,16 @@ describe('workers/branch/index', () => {
     it('skips branch for fresh release with stabilityDays', async () => {
       schedule.isScheduledNow.mockReturnValueOnce(true);
       config.prCreation = 'not-pending';
-      config.upgrades = [
+      (config.upgrades as Partial<BranchUpgradeConfig>[]) = [
         {
-          releaseTimestamp: new Date('2019-01-01').getTime(),
+          releaseTimestamp: new Date('2019-01-01').getTime().toString(),
           stabilityDays: 1,
         },
         {
-          releaseTimestamp: new Date().getTime(),
+          releaseTimestamp: new Date().toString(),
           stabilityDays: 1,
         },
-        /* TODO: This test is probably broken and needs to be fixed.
-           The type definition for "releaseTimestamp" is a string. But when I change it to
-           one the test starts failing. Once this test has been fixed, the never typing can be removed.
-           And instead replaced with the pattern used on the other places that have a config.upgrades
-           (#9718)
-        */
-      ] as never;
+      ];
 
       git.branchExists.mockReturnValue(false);
       const res = await branchWorker.processBranch(config);
-- 
GitLab