From 239fb93a2402ceed75f4cc08dd6df679e9309651 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Wed, 20 Dec 2017 07:26:29 +0100 Subject: [PATCH] chore: add test for packageNames + packagePatterns combined --- test/workers/dep-type/index.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/workers/dep-type/index.spec.js b/test/workers/dep-type/index.spec.js index d21e227db4..386f5e3044 100644 --- a/test/workers/dep-type/index.spec.js +++ b/test/workers/dep-type/index.spec.js @@ -117,6 +117,23 @@ describe('lib/workers/dep-type/index', () => { }, ], }; + it('supports inclusive or', () => { + const nConfig = { + packageRules: [ + { + packageNames: ['neutrino'], + packagePatterns: ['^@neutrino\\/'], + x: 1, + }, + ], + }; + const res1 = depTypeWorker.getDepConfig(nConfig, { depName: 'neutrino' }); + expect(res1.x).toBeDefined(); + const res2 = depTypeWorker.getDepConfig(nConfig, { + depName: '@neutrino/something', + }); + expect(res2.x).toBeDefined(); + }); it('applies both rules for a', () => { const dep = { depName: 'a', -- GitLab