-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,23 @@ test('it does not filter out changes that are on the exclusions list', async () | |
expect(invalidLicenses.forbidden.length).toEqual(0) | ||
}) | ||
|
||
test('it does not fail when the packages dont have a valid PURL', async () => { | ||
const emptyPurlChange = pipChange | ||
emptyPurlChange.package_url = '' | ||
|
||
const changes: Changes = [emptyPurlChange, npmChange, rubyChange] | ||
const licensesConfig = { | ||
allow: ['BSD'], | ||
licenseExclusions: ['pkg:pip/[email protected]', 'pkg:npm/[email protected]'] | ||
} | ||
|
||
const invalidLicenses = await getInvalidLicenseChanges( | ||
changes, | ||
licensesConfig | ||
) | ||
expect(invalidLicenses.forbidden.length).toEqual(1) | ||
}) | ||
|
||
test('it does filters out changes if they are not on the exclusions list', async () => { | ||
const changes: Changes = [pipChange, npmChange, rubyChange] | ||
const licensesConfig = { | ||
|