From e320f343f8d18a301bc1d74dcb2816e3d1e3be6f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 26 Jul 2018 14:14:14 +0200 Subject: Add support for testing installations post-publish as well --- packages/monorepo-scripts/src/test_installation.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'packages/monorepo-scripts/src') diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index a9610e5ee..12c0e7603 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -9,6 +9,8 @@ import * as rimraf from 'rimraf'; import { utils } from './utils/utils'; (async () => { + const IS_LOCAL_PUBLISH = process.env.IS_LOCAL_PUBLISH === 'true'; + const registry = IS_LOCAL_PUBLISH ? 'http://localhost:4873' : 'https://registry.npmjs.org'; const monorepoRootPath = path.join(__dirname, '../../..'); const packages = utils.getTopologicallySortedPackages(monorepoRootPath); const installablePackages = _.filter( @@ -26,9 +28,9 @@ import { utils } from './utils/utils'; fs.mkdirSync(testDirectory); await execAsync('yarn init --yes', { cwd: testDirectory }); const npmrcFilePath = path.join(testDirectory, '.npmrc'); - fs.writeFileSync(npmrcFilePath, `registry=http://localhost:4873`); + fs.writeFileSync(npmrcFilePath, `registry=${registry}`); utils.log(`Installing ${packageName}@${lastChangelogVersion}`); - await execAsync(`npm install --save ${packageName}@${lastChangelogVersion} --registry=http://localhost:4873`, { + await execAsync(`npm install --save ${packageName}@${lastChangelogVersion} --registry=${registry}`, { cwd: testDirectory, }); const indexFilePath = path.join(testDirectory, 'index.ts'); -- cgit v1.2.3