Skip to content

Commit

Permalink
fix: add missing multipleVersions option to validated schema
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed Mar 10, 2024
1 parent a64478a commit 889dfbc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/license-plugin-option.js
Expand Up @@ -62,6 +62,7 @@ const SCHEMA = {
validators.func(),
validators.object({
includePrivate: validators.boolean(),
multipleVersions: validators.boolean(),

allow: [
validators.string(),
Expand Down
20 changes: 20 additions & 0 deletions test/integration/it.spec.js
Expand Up @@ -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'),
Expand Down

0 comments on commit 889dfbc

Please sign in to comment.