From 7afb49de3108875084b7e2a5a37ff42c68812b3f Mon Sep 17 00:00:00 2001
From: RahulGautamSingh <rahultesnik@gmail.com>
Date: Mon, 15 Aug 2022 16:36:22 +0530
Subject: [PATCH] test: add assertion to test ensureCommentRemoval in dryRun
 (#17183)

add assertion
---
 .../repository/update/branch/index.spec.ts        | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/lib/workers/repository/update/branch/index.spec.ts b/lib/workers/repository/update/branch/index.spec.ts
index fad21dc948..4e9c147daf 100644
--- a/lib/workers/repository/update/branch/index.spec.ts
+++ b/lib/workers/repository/update/branch/index.spec.ts
@@ -991,10 +991,12 @@ describe('workers/repository/update/branch/index', () => {
     });
 
     it('branch pr no schedule (dry run)', async () => {
-      getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce({
-        updatedPackageFiles: [{}],
-        artifactErrors: [{}],
-      } as PackageFilesResult);
+      getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce(
+        partial<PackageFilesResult>({
+          updatedPackageFiles: [],
+          artifactErrors: [],
+        })
+      );
       npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({
         artifactErrors: [],
         updatedArtifacts: [partial<FileChange>({})],
@@ -1019,13 +1021,16 @@ describe('workers/repository/update/branch/index', () => {
       expect(
         await branchWorker.processBranch({
           ...config,
-          artifactErrors: [{}],
+          artifactErrors: [],
         })
       ).toEqual({
         branchExists: true,
         prNo: undefined,
         result: 'done',
       });
+      expect(logger.info).toHaveBeenCalledWith(
+        'DRY-RUN: Would ensure comment removal in PR #undefined'
+      );
     });
 
     it('branch pr no schedule', async () => {
-- 
GitLab