From 0187e0c47df98bac67da135b55e2630e25ffd513 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 26 Jul 2018 16:20:20 +0200 Subject: Still test unrunnable packages for compilation issues --- packages/monorepo-scripts/src/test_installation.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 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 bbaf9b056..a8ddf0c58 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -21,14 +21,11 @@ const UNRUNNABLE_PACKAGES = [ const registry = IS_LOCAL_PUBLISH ? 'http://localhost:4873/' : 'https://registry.npmjs.org/'; const monorepoRootPath = path.join(__dirname, '../../..'); const packages = utils.getTopologicallySortedPackages(monorepoRootPath); - const preInstallablePackages = _.filter( + const installablePackages = _.filter( packages, pkg => !pkg.packageJson.private && !_.isUndefined(pkg.packageJson.main) && pkg.packageJson.main.endsWith('.js'), ); utils.log('Testing packages:'); - const installablePackages = _.filter(preInstallablePackages, pkg => { - return !_.includes(UNRUNNABLE_PACKAGES, pkg.packageJson.name); - }); _.map(installablePackages, pkg => utils.log(`* ${pkg.packageJson.name}`)); for (const installablePackage of installablePackages) { const changelogPath = path.join(installablePackage.location, 'CHANGELOG.json'); @@ -66,10 +63,13 @@ const UNRUNNABLE_PACKAGES = [ const tscBinaryPath = path.join(monorepoRootPath, './node_modules/typescript/bin/tsc'); await execAsync(tscBinaryPath, { cwd: testDirectory }); utils.log(`Successfully compiled with ${packageName} as a dependency`); - const transpiledIndexFilePath = path.join(testDirectory, 'index.js'); - utils.log(`Running test script with ${packageName} imported`); - await execAsync(`node ${transpiledIndexFilePath}`); - utils.log(`Successfilly ran test script with ${packageName} imported`); + const isUnrunnablePkg = _.includes(UNRUNNABLE_PACKAGES, packageName); + if (!isUnrunnablePkg) { + const transpiledIndexFilePath = path.join(testDirectory, 'index.js'); + utils.log(`Running test script with ${packageName} imported`); + await execAsync(`node ${transpiledIndexFilePath}`); + utils.log(`Successfilly ran test script with ${packageName} imported`); + } rimraf.sync(testDirectory); } })().catch(err => { -- cgit v1.2.3