Skip to content

Commit 47ec470

Browse files
committed
Refactor tests
1 parent 203f6e5 commit 47ec470

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

componentDetection.test.ts

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

22-
describe("ComponentDetection.makePackageUrl", () => {
23-
test("returns an empty string when packageUrlJson is null", () => {
24-
const packageUrl = ComponentDetection.makePackageUrl(null);
25-
expect(packageUrl).toBe("");
26-
});
27-
test("returns an empty string for null packageUrlJson properties", () => {
28-
const packageUrl = ComponentDetection.makePackageUrl({
29-
Scheme: null,
30-
Type: null,
31-
Namespace: null,
32-
Name: null,
33-
Version: null,
34-
Qualifiers: null
35-
});
36-
expect(packageUrl).toBe("");
37-
});
38-
});
39-
4022
describe("ComponentDetection.makePackageUrl", () => {
4123
test("returns a valid package url from saturated object", () => {
4224
const packageUrl = ComponentDetection.makePackageUrl({
@@ -68,4 +50,21 @@ describe("ComponentDetection.makePackageUrl", () => {
6850
"pkg:npm/github/[email protected]"
6951
);
7052
});
53+
54+
test("returns an empty string when packageUrlJson is null", () => {
55+
const packageUrl = ComponentDetection.makePackageUrl(null);
56+
expect(packageUrl).toBe("");
57+
});
58+
59+
test("returns an empty string for null packageUrlJson properties", () => {
60+
const packageUrl = ComponentDetection.makePackageUrl({
61+
Scheme: null,
62+
Type: null,
63+
Namespace: null,
64+
Name: null,
65+
Version: null,
66+
Qualifiers: null
67+
});
68+
expect(packageUrl).toBe("");
69+
});
7170
});

0 commit comments

Comments
 (0)