Skip to content

Commit

Permalink
test(CRA-e2e): add execSync output
Browse files Browse the repository at this point in the history
issue #14
  • Loading branch information
sabertazimi committed Aug 12, 2021
1 parent 146f27b commit a296c45
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions scripts/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,33 @@ class Test {
}

startLocalRegistry() {
consola.info('Start verdaccio server ...');
cp.execSync(
`nohup npx verdaccio -c ${this.localRegistryConfigPath} &>${this.localRegistryLogPath} &`
);
cp.execSync(
`grep -q 'http address' <(tail -f ${this.localRegistryLogPath})`
`grep -q 'http address' <(tail -f ${this.localRegistryLogPath})`,
{ stdio: 'inherit' }
);
cp.execSync(`npm set registry "${this.localRegistry}"`);
cp.execSync(`npm set registry "${this.localRegistry}"`, {
stdio: 'inherit',
});
}

stopLocalRegistry() {
cp.execSync(`npm set registry ${this.originalRegistry}`);
cp.execSync(`npm set registry ${this.originalRegistry}`, {
stdio: 'inherit',
});
}

publishToLocalRegistry() {
// cp.execSync('git clean -df');
cp.execSync('npm run publish');
cp.execSync('npm run publish', { stdio: 'inherit' });
}

cleanUp() {
consola.info('Cleaning up.');
// cp.execSync('git checkout -- packages/*/package.json');
consola.info('Cleaning up ...');
cp.execSync('git checkout -- packages/*/package.json');
this.stopLocalRegistry();
}

Expand All @@ -63,7 +69,7 @@ class Test {
}

handleError(error: Error) {
consola.error('ERROR! An error was encountered while executing');
consola.error('An error was encountered while executing');
consola.error(error);
this.cleanUp();
consola.info('Exiting with error.');
Expand Down

0 comments on commit a296c45

Please sign in to comment.