Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
Stop clearing console when testing
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kelly committed Sep 6, 2018
1 parent 6725d30 commit 6b81586
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
7 changes: 6 additions & 1 deletion packages/slate-analytics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ async function init() {
event('slate-analytics:renew-consent-true', config);
}

clearConsole();
if (
process.env.NODE_ENV !== 'test' && // eslint-disable-line no-process-env
process.env.NODE_ENV !== 'test-slate-analytics' // eslint-disable-line no-process-env
) {
clearConsole();
}
console.log(`Thanks for helping improve the Slate development experience!`);
}

Expand Down
6 changes: 5 additions & 1 deletion packages/slate-analytics/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ const question = {
};

function forNewConsent() {
clearConsole();
// eslint-disable-next-line no-process-env
if (process.env.NODE_ENV !== 'test') {
clearConsole();
}

console.log(
wrap(
'👋 Welcome to Slate! During the alpha, we would like to gather usage analytics, such as interactions with Slate commands, performance reports, and error occurances. The data does not include any sensitive information. The detailed list of data we gather can be found at:',
Expand Down
11 changes: 9 additions & 2 deletions packages/slate-tools/cli/commands/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,22 @@ Promise.all([
});

function onCompilerCompile() {
clearConsole();
// eslint-disable-next-line no-process-env
if (process.env.NODE_ENV !== 'test') {
clearConsole();
}
spinner.start();
}

function onCompilerDone(stats) {
const statsJson = stats.toJson({}, true);

spinner.stop();
clearConsole();

// eslint-disable-next-line no-process-env
if (process.env.NODE_ENV !== 'test') {
clearConsole();
}

if (statsJson.errors.length) {
event('slate-tools:start:compile-errors', {
Expand Down

0 comments on commit 6b81586

Please sign in to comment.