diff --git a/src/lib/config-utils.js b/src/lib/config-utils.js index d4c1eac98..cd6ccad35 100644 --- a/src/lib/config-utils.js +++ b/src/lib/config-utils.js @@ -107,7 +107,7 @@ export function normalisePackageAccess(packages: PackageList): PackageList { const normalizedPkgs: PackageList = {...packages}; // add a default rule for all packages to make writing plugins easier if (_.isNil(normalizedPkgs['**'])) { - normalizedPkgs['**'] = {}; + normalizedPkgs['**'] = {access: [], publish: []}; } for (let pkg in packages) { diff --git a/test/unit/api/config-utils.spec.js b/test/unit/api/config-utils.spec.js index 667db85b5..6aabb33e9 100644 --- a/test/unit/api/config-utils.spec.js +++ b/test/unit/api/config-utils.spec.js @@ -1,6 +1,7 @@ // @flow import path from 'path'; +import _ from 'lodash'; import {spliceURL} from '../../../src/utils/string'; import {parseConfigFile} from '../../../src/lib/utils'; import { @@ -125,12 +126,14 @@ describe('Config Utilities', () => { const scoped = access[`${PACKAGE_ACCESS.SCOPE}`]; expect(scoped).toBeUndefined(); - // ** should be added by default + // ** should be added by default ** const all = access[`${PACKAGE_ACCESS.ALL}`]; expect(all).toBeDefined(); - expect(all.access).toBeUndefined(); - expect(all.publish).toBeUndefined(); + expect(all.access).toBeDefined(); + expect(_.isArray(all.access)).toBeTruthy(); + expect(all.publish).toBeDefined(); + expect(_.isArray(all.publish)).toBeTruthy(); }); });