From 889dfbc79421529f9966acc3293359f9d1420948 Mon Sep 17 00:00:00 2001 From: Mickael Jeanroy Date: Sun, 10 Mar 2024 15:52:25 +0100 Subject: [PATCH] fix: add missing multipleVersions option to validated schema --- src/license-plugin-option.js | 1 + test/integration/it.spec.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/license-plugin-option.js b/src/license-plugin-option.js index 6a8067b8..418c0498 100644 --- a/src/license-plugin-option.js +++ b/src/license-plugin-option.js @@ -62,6 +62,7 @@ const SCHEMA = { validators.func(), validators.object({ includePrivate: validators.boolean(), + multipleVersions: validators.boolean(), allow: [ validators.string(), diff --git a/test/integration/it.spec.js b/test/integration/it.spec.js index a4ff8bfa..1aa4effd 100644 --- a/test/integration/it.spec.js +++ b/test/integration/it.spec.js @@ -284,6 +284,26 @@ describe('rollup-plugin-license', () => { }); }); + it('should generate bundle with multipleVersion flag', (done) => { + const thirdPartyOutput = path.join(tmpDir.name, 'dependencies.txt'); + const rollupConfig = createRollupConfig({ + thirdParty: { + includePrivate: false, + multipleVersions: true, + output: { + file: thirdPartyOutput, + }, + }, + }); + + writeBundle(rollupConfig).then(() => { + verifyFile(thirdPartyOutput, done, (data) => { + expect(warn).not.toHaveBeenCalled(); + expect(data.toString()).toContain('lodash'); + }); + }); + }); + function createRollupConfig(licensePluginOptions) { return { input: path.join(__dirname, 'bundle.js'),