diff --git a/__tests__/commands/install/integration.js b/__tests__/commands/install/integration.js index 60a6f4dcfb..cad6455f0e 100644 --- a/__tests__/commands/install/integration.js +++ b/__tests__/commands/install/integration.js @@ -48,6 +48,11 @@ async function mockConstants(base: Config, mocks: Object, cb: (config: Config) = beforeEach(request.__resetAuthedRequests); afterEach(request.__resetAuthedRequests); +test('install should not copy the .bin folders from the cache', () => + runInstall({}, 'install-no-bin', async config => { + expect(await fs.exists(`${config.cwd}/node_modules/is-pnp/.bin`)).toEqual(false); + })); + test('install should not hoist packages above their peer dependencies', () => runInstall({}, 'install-should-not-hoist-through-peer-deps', async config => { expect(await fs.exists(`${config.cwd}/node_modules/a/node_modules/c`)).toEqual(true); diff --git a/__tests__/fixtures/install/install-no-bin/package.json b/__tests__/fixtures/install/install-no-bin/package.json new file mode 100644 index 0000000000..5736570f54 --- /dev/null +++ b/__tests__/fixtures/install/install-no-bin/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "is-pnp": "^1.0.2" + } +} diff --git a/src/package-linker.js b/src/package-linker.js index c0f69d921a..463a9835ce 100644 --- a/src/package-linker.js +++ b/src/package-linker.js @@ -444,7 +444,7 @@ export default class PackageLinker { possibleExtraneous, artifactFiles, - ignoreBasenames: [constants.METADATA_FILENAME, constants.TARBALL_FILENAME], + ignoreBasenames: [constants.METADATA_FILENAME, constants.TARBALL_FILENAME, '.bin'], onStart: (num: number) => { tick = this.reporter.progress(num);