Refactor tests
This commit is contained in:
+17
-18
@@ -19,24 +19,6 @@ test("Parses CLI output", async () => {
|
||||
expect(manifests?.length == 2);
|
||||
});
|
||||
|
||||
describe("ComponentDetection.makePackageUrl", () => {
|
||||
test("returns an empty string when packageUrlJson is null", () => {
|
||||
const packageUrl = ComponentDetection.makePackageUrl(null);
|
||||
expect(packageUrl).toBe("");
|
||||
});
|
||||
test("returns an empty string for null packageUrlJson 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({
|
||||
@@ -68,4 +50,21 @@ describe("ComponentDetection.makePackageUrl", () => {
|
||||
"pkg:npm/github/component-detection-action@0.0.2"
|
||||
);
|
||||
});
|
||||
|
||||
test("returns an empty string when packageUrlJson is null", () => {
|
||||
const packageUrl = ComponentDetection.makePackageUrl(null);
|
||||
expect(packageUrl).toBe("");
|
||||
});
|
||||
|
||||
test("returns an empty string for null packageUrlJson properties", () => {
|
||||
const packageUrl = ComponentDetection.makePackageUrl({
|
||||
Scheme: null,
|
||||
Type: null,
|
||||
Namespace: null,
|
||||
Name: null,
|
||||
Version: null,
|
||||
Qualifiers: null
|
||||
});
|
||||
expect(packageUrl).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user