Skip to content
Permalink
Browse files

Print experiments warning in CLI file, not reporters

  • Loading branch information...
novemberborn committed Sep 22, 2019
1 parent 7c535b2 commit 2c3bb0c40b1a927ec4f21e8ba7623f7facd7cbaa
Showing with 6 additions and 11 deletions.
  1. +0 −1 lib/api.js
  2. +6 −2 lib/cli.js
  3. +0 −4 lib/reporters/mini.js
  4. +0 −3 lib/reporters/verbose.js
  5. +0 −1 profile.js
@@ -149,7 +149,6 @@ class Api extends Emittery {

await this.emit('run', {
clearLogOnNextRun: runtimeOptions.clearLogOnNextRun === true,
experiments: Object.keys(apiOptions.experiments),
failFastEnabled: failFast,
filePathPrefix: commonPathPrefix(files),
files,
@@ -132,7 +132,7 @@ exports.run = async () => { // eslint-disable-line complexity
}
}

const {projectDir} = conf;
const {nonSemVerExperiments: experiments, projectDir} = conf;
if (cli.flags.resetCache) {
const cacheDir = path.join(projectDir, 'node_modules', '.cache', 'ava');
try {
@@ -164,6 +164,10 @@ exports.run = async () => { // eslint-disable-line complexity
exit('The --concurrency or -c flag must be provided with a nonnegative integer.');
}

if (!conf.tap && Object.keys(experiments).length > 0) {
console.log(chalk.magenta(` ${figures.warning} Experiments are enabled. These are unsupported and may change or be removed at any time.`));
}

const ciParallelVars = require('ci-parallel-vars');
const Api = require('./api');
const VerboseReporter = require('./reporters/verbose');
@@ -238,7 +242,7 @@ exports.run = async () => { // eslint-disable-line complexity
color: conf.color,
compileEnhancements: conf.compileEnhancements !== false,
concurrency: conf.concurrency ? parseInt(conf.concurrency, 10) : 0,
experiments: conf.nonSemVerExperiments,
experiments,
extensions,
failFast: conf.failFast,
failWithoutAssertions: conf.failWithoutAssertions !== false,
@@ -136,10 +136,6 @@ class MiniReporter {
cliCursor.hide(this.reportStream);
this.lineWriter.writeLine();

if (plan.experiments.length > 0) {
this.lineWriter.writeLine(colors.information(`${figures.warning} Experiments are enabled. These are unsupported and may change or be be removed at any time.`));
}

this.spinner.start();
}

@@ -97,9 +97,6 @@ class VerboseReporter {
}

this.lineWriter.writeLine();
if (plan.experiments.length > 0) {
this.lineWriter.writeLine(colors.information(`${figures.warning} Experiments are enabled. These are unsupported and may change or be removed at any time.${os.EOL}`));
}
}

consumeStateChange(evt) { // eslint-disable-line complexity
@@ -145,7 +145,6 @@ runStatus.observeWorker({
}, file);

reporter.startRun({
experiments: [],
failFastEnabled: false,
files: [file],
matching: false,

0 comments on commit 2c3bb0c

Please sign in to comment.
You can’t perform that action at this time.