Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Oct 1, 2024
1 parent a1e6b50 commit 5b67dc7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ export function hasAnyProjectType(projectTypes, options, defaultStatus = true) {
}
// If only exclude type is specified, then do not allow oci type
if (
projectTypes?.length === 1 &&
(projectTypes?.length === 1 || !defaultStatus) &&
!options.projectType?.length &&
options.excludeType?.length
) {
Expand Down
10 changes: 10 additions & 0 deletions lib/helpers/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5003,4 +5003,14 @@ test("hasAnyProjectType tests", () => {
excludeType: ["jar"],
}),
).toBeFalsy();
expect(
hasAnyProjectType(
["docker", "oci", "container", "os"],
{
projectType: undefined,
excludeType: ["github"],
},
false,
),
).toBeFalsy();
});

0 comments on commit 5b67dc7

Please sign in to comment.