Handle unknown licenses.

This commit is contained in:
Federico Builes
2022-06-14 13:54:27 +02:00
parent 0b87f02bee
commit 42e2bc1ed2
5 changed files with 49 additions and 27 deletions

View File

@@ -48,13 +48,13 @@ let rubyChange: Change = {
test('it fails if a license outside the allow list is found', async () => {
const changes: Changes = [npmChange, rubyChange]
const invalidChanges = getDeniedLicenseChanges(changes, {allow: ['BSD']})
const [invalidChanges, _] = getDeniedLicenseChanges(changes, {allow: ['BSD']})
expect(invalidChanges[0]).toBe(npmChange)
})
test('it fails if a license inside the deny list is found', async () => {
const changes: Changes = [npmChange, rubyChange]
const invalidChanges = getDeniedLicenseChanges(changes, {deny: ['BSD']})
const [invalidChanges] = getDeniedLicenseChanges(changes, {deny: ['BSD']})
expect(invalidChanges[0]).toBe(rubyChange)
})
@@ -62,7 +62,7 @@ test('it fails if a license inside the deny list is found', async () => {
// thing we want in the system. Please remove this test after refactoring.
test('it fails all license checks when allow is provided an empty array', async () => {
const changes: Changes = [npmChange, rubyChange]
let invalidChanges = getDeniedLicenseChanges(changes, {
let [invalidChanges, _] = getDeniedLicenseChanges(changes, {
allow: [],
deny: ['BSD']
})