From a6a736172f69b0295d54b7b8c791ca495d30feb3 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Thu, 12 Mar 2020 06:32:31 +0100
Subject: [PATCH] fix(html): skip extracted files if no deps

---
 lib/manager/html/__fixtures__/nothing.html |  4 ++++
 lib/manager/html/extract.spec.ts           | 11 +++++++++--
 lib/manager/html/extract.ts                |  1 +
 3 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 lib/manager/html/__fixtures__/nothing.html

diff --git a/lib/manager/html/__fixtures__/nothing.html b/lib/manager/html/__fixtures__/nothing.html
new file mode 100644
index 0000000000..e54fbbdee8
--- /dev/null
+++ b/lib/manager/html/__fixtures__/nothing.html
@@ -0,0 +1,4 @@
+<html>
+  <head><title>Hello World</title></head>
+  <body>Renovate</body>
+</html>
diff --git a/lib/manager/html/extract.spec.ts b/lib/manager/html/extract.spec.ts
index c7ddaeb96c..1c2e788097 100644
--- a/lib/manager/html/extract.spec.ts
+++ b/lib/manager/html/extract.spec.ts
@@ -2,13 +2,20 @@ import { readFileSync } from 'fs';
 import { resolve } from 'path';
 import { extractPackageFile } from '.';
 
-const input = readFileSync(
+const sample = readFileSync(
   resolve(__dirname, `./__fixtures__/sample.html`),
   'utf8'
 );
+const nothing = readFileSync(
+  resolve(__dirname, `./__fixtures__/nothing.html`),
+  'utf8'
+);
 
 describe('manager/html/extract', () => {
   it('extractPackageFile', () => {
-    expect(extractPackageFile(input)).toMatchSnapshot();
+    expect(extractPackageFile(sample)).toMatchSnapshot();
+  });
+  it('returns null', () => {
+    expect(extractPackageFile(nothing)).toBeNull();
   });
 });
diff --git a/lib/manager/html/extract.ts b/lib/manager/html/extract.ts
index 92e63f181c..7de5d13d0a 100644
--- a/lib/manager/html/extract.ts
+++ b/lib/manager/html/extract.ts
@@ -45,5 +45,6 @@ export function extractPackageFile(content: string): PackageFile {
       });
     }
   }
+  if (!deps.length) return null;
   return { deps };
 }
-- 
GitLab