From fe7892013976f0947600bafeaf8a2633be3fd367 Mon Sep 17 00:00:00 2001 From: Federico Builes Date: Mon, 13 Jun 2022 20:04:39 +0200 Subject: [PATCH] Document unwanted behavior for a future refactoring. --- __tests__/licenses.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/__tests__/licenses.test.ts b/__tests__/licenses.test.ts index 08918a4..8ad09b0 100644 --- a/__tests__/licenses.test.ts +++ b/__tests__/licenses.test.ts @@ -57,3 +57,14 @@ test('it fails if a license inside the deny list is found', async () => { const invalidChanges = getDeniedLicenseChanges(changes, {deny: ['BSD']}) expect(invalidChanges[0]).toBe(rubyChange) }) + +// This is more of a "here's a behavior that might be surprising" than an actual +// 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, { + allow: [], + deny: ['BSD'] + }) + expect(invalidChanges.length).toBe(2) +})