adding a test for empty PURLs
This commit is contained in:
@@ -192,6 +192,23 @@ test('it does not filter out changes that are on the exclusions list', async ()
|
|||||||
expect(invalidLicenses.forbidden.length).toEqual(0)
|
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 () => {
|
test('it does filters out changes if they are not on the exclusions list', async () => {
|
||||||
const changes: Changes = [pipChange, npmChange, rubyChange]
|
const changes: Changes = [pipChange, npmChange, rubyChange]
|
||||||
const licensesConfig = {
|
const licensesConfig = {
|
||||||
|
|||||||
Reference in New Issue
Block a user