From b69d2d201bd5fa8dbd0963196d3f0bb9d8b92ee8 Mon Sep 17 00:00:00 2001 From: Chad Bentz <1760475+felickz@users.noreply.github.com> Date: Mon, 12 May 2025 21:08:26 +0000 Subject: [PATCH] Add tests --- componentDetection.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/componentDetection.test.ts b/componentDetection.test.ts index 45be603..5840c36 100644 --- a/componentDetection.test.ts +++ b/componentDetection.test.ts @@ -19,6 +19,27 @@ test("Parses CLI output", async () => { expect(manifests?.length == 2); }); +describe("ComponentDetection.makePackageUrl", () => { + test("returns a empty valid package url from null object", () => { + const packageUrl = ComponentDetection.makePackageUrl(null); + expect(packageUrl).toBe(""); + }); +}); + +describe("ComponentDetection.makePackageUrl", () => { + test("returns a empty valid package url from null object properties", () => { + const packageUrl = ComponentDetection.makePackageUrl({ + Scheme: null, + Type: null, + Namespace: null, + Name: null, + Version: null, + Qualifiers: null + }); + expect(packageUrl).toBe(""); + }); +}); + describe("ComponentDetection.makePackageUrl", () => { test("returns a valid package url from saturated object", () => { const packageUrl = ComponentDetection.makePackageUrl({