Skip to content

Commit

Permalink
Add more test for added and removed pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Jul 13, 2022
1 parent ae4118f commit c003e7f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions __tests__/licenses.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,13 @@ test('it does not fail if a license inside the deny list is found in removed cha
const [invalidChanges, _] = getDeniedLicenseChanges(changes, {deny: ['BSD']})
expect(invalidChanges).toStrictEqual([])
})

test('it fails if a license outside the allow list is found in both of added and removed changes', async () => {
const changes: Changes = [
{...npmChange, change_type: 'removed'},
npmChange,
{...rubyChange, change_type: 'removed'}
]
const [invalidChanges, _] = getDeniedLicenseChanges(changes, {allow: ['BSD']})
expect(invalidChanges).toStrictEqual([npmChange])
})

0 comments on commit c003e7f

Please sign in to comment.