From b4e8c54716b5a4f370635a824412b8857923dffb Mon Sep 17 00:00:00 2001
From: Sergei Zharinov <zharinov@users.noreply.github.com>
Date: Mon, 10 Jan 2022 18:56:50 +0300
Subject: [PATCH] refactor(datasource/artifactory): Enable strict null checks
 (#13446)

Co-authored-by: Rhys Arkins <rhys@arkins.net>
---
 lib/datasource/artifactory/index.spec.ts | 6 +++---
 tsconfig.strict.json                     | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/datasource/artifactory/index.spec.ts b/lib/datasource/artifactory/index.spec.ts
index ff16119030..693e46c12e 100644
--- a/lib/datasource/artifactory/index.spec.ts
+++ b/lib/datasource/artifactory/index.spec.ts
@@ -37,7 +37,7 @@ describe('datasource/artifactory/index', () => {
         datasource,
         lookupName: testLookupName,
       });
-      expect(res.releases).toHaveLength(4);
+      expect(res?.releases).toHaveLength(4);
       expect(res).toMatchSnapshot({
         registryUrl: 'https://jfrog.company.com/artifactory',
       });
@@ -53,7 +53,7 @@ describe('datasource/artifactory/index', () => {
         datasource,
         lookupName: testLookupName,
       });
-      expect(res.releases).toHaveLength(4);
+      expect(res?.releases).toHaveLength(4);
       expect(res).toMatchSnapshot({
         registryUrl: 'https://jfrog.company.com/artifactory',
       });
@@ -78,7 +78,7 @@ describe('datasource/artifactory/index', () => {
         datasource,
         lookupName: testLookupName,
       });
-      expect(res.releases).toHaveLength(5);
+      expect(res?.releases).toHaveLength(5);
       expect(res).toMatchSnapshot();
     });
 
diff --git a/tsconfig.strict.json b/tsconfig.strict.json
index abbedf333e..f985628d41 100644
--- a/tsconfig.strict.json
+++ b/tsconfig.strict.json
@@ -14,6 +14,7 @@
     "lib/data-files.generated.ts",
     "lib/datasource/**/common.ts",
     "lib/datasource/**/types.ts",
+    "lib/datasource/artifactory",
     "lib/datasource/gitlab-tags/util.ts",
     "lib/datasource/helm/common.ts",
     "lib/datasource/metadata.ts",
@@ -90,6 +91,7 @@
   ],
   "exclude": [
     "lib/constants/platform.spec.ts",
+    "lib/datasource/artifactory/**/*.spec.ts",
     "lib/datasource/docker/common.ts",
     "lib/datasource/github-releases/common.ts",
     "lib/datasource/go/common.ts",
-- 
GitLab