Skip to content

Commit b69d2d2

Browse files
committed
Add tests
1 parent 5840bc4 commit b69d2d2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

componentDetection.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ test("Parses CLI output", async () => {
1919
expect(manifests?.length == 2);
2020
});
2121

22+
describe("ComponentDetection.makePackageUrl", () => {
23+
test("returns a empty valid package url from null object", () => {
24+
const packageUrl = ComponentDetection.makePackageUrl(null);
25+
expect(packageUrl).toBe("");
26+
});
27+
});
28+
29+
describe("ComponentDetection.makePackageUrl", () => {
30+
test("returns a empty valid package url from null object properties", () => {
31+
const packageUrl = ComponentDetection.makePackageUrl({
32+
Scheme: null,
33+
Type: null,
34+
Namespace: null,
35+
Name: null,
36+
Version: null,
37+
Qualifiers: null
38+
});
39+
expect(packageUrl).toBe("");
40+
});
41+
});
42+
2243
describe("ComponentDetection.makePackageUrl", () => {
2344
test("returns a valid package url from saturated object", () => {
2445
const packageUrl = ComponentDetection.makePackageUrl({

0 commit comments

Comments
 (0)