aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-26 21:32:30 +0800
committerFabio Berger <me@fabioberger.com>2018-07-26 21:32:30 +0800
commite3cfa6363daf8b46b231fb38fc1bf6c8e13db17b (patch)
treebb814b689fbf74e0be4a1d92f20fa67f7920b933 /packages/monorepo-scripts
parent331b1cb9a0edd8809c82393ed482674e61a76636 (diff)
downloaddexon-sol-tools-e3cfa6363daf8b46b231fb38fc1bf6c8e13db17b.tar
dexon-sol-tools-e3cfa6363daf8b46b231fb38fc1bf6c8e13db17b.tar.gz
dexon-sol-tools-e3cfa6363daf8b46b231fb38fc1bf6c8e13db17b.tar.bz2
dexon-sol-tools-e3cfa6363daf8b46b231fb38fc1bf6c8e13db17b.tar.lz
dexon-sol-tools-e3cfa6363daf8b46b231fb38fc1bf6c8e13db17b.tar.xz
dexon-sol-tools-e3cfa6363daf8b46b231fb38fc1bf6c8e13db17b.tar.zst
dexon-sol-tools-e3cfa6363daf8b46b231fb38fc1bf6c8e13db17b.zip
Change test:installation so it also causes run-time errors to appear
Diffstat (limited to 'packages/monorepo-scripts')
-rw-r--r--packages/monorepo-scripts/src/test_installation.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts
index b10db5a06..4c92d0aa2 100644
--- a/packages/monorepo-scripts/src/test_installation.ts
+++ b/packages/monorepo-scripts/src/test_installation.ts
@@ -13,11 +13,14 @@ import { utils } from './utils/utils';
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(
+ const preInstallablePackages = _.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 pkg.packageJson.name === '0x.js';
+ });
_.map(installablePackages, pkg => utils.log(`* ${pkg.packageJson.name}`));
for (const installablePackage of installablePackages) {
const changelogPath = path.join(installablePackage.location, 'CHANGELOG.json');
@@ -35,7 +38,7 @@ import { utils } from './utils/utils';
cwd: testDirectory,
});
const indexFilePath = path.join(testDirectory, 'index.ts');
- fs.writeFileSync(indexFilePath, `import * as Package from '${packageName}';\n`);
+ fs.writeFileSync(indexFilePath, `import * as Package from '${packageName}';\nconsole.log(Package);\n`);
const tsConfig = {
compilerOptions: {
typeRoots: ['node_modules/@0xproject/typescript-typings/types', 'node_modules/@types'],
@@ -55,7 +58,11 @@ import { utils } from './utils/utils';
const tscBinaryPath = path.join(monorepoRootPath, './node_modules/typescript/bin/tsc');
await execAsync(tscBinaryPath, { cwd: testDirectory });
utils.log(`Successfully compiled with ${packageName} as a dependency`);
- rimraf.sync(testDirectory);
+ 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 => {
utils.log(err.stderr);