Skip to content

Commit

Permalink
Remove checks against very old config options and related cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn committed Jun 25, 2023
1 parent 6f62c2d commit 1fff08d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
26 changes: 5 additions & 21 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,33 +317,17 @@ export default async function loadCli() { // eslint-disable-line complexity
}

if (Object.hasOwn(combined, 'concurrency') && (!Number.isInteger(combined.concurrency) || combined.concurrency < 0)) {
exit('The --concurrency or -c flag must be provided with a nonnegative integer.');
}

if (!combined.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.`));
}

if (Object.hasOwn(conf, 'babel')) {
exit('Built-in Babel support has been removed.');
}

if (Object.hasOwn(conf, 'compileEnhancements')) {
exit('Enhancement compilation must be configured in AVA’s Babel options.');
}

if (Object.hasOwn(conf, 'helpers')) {
exit('AVA no longer compiles helpers. Add exclusion patterns to the ’files’ configuration and specify ’compileAsTests’ in the Babel options instead.');
}

if (Object.hasOwn(conf, 'sources')) {
exit('’sources’ has been removed. Use ’ignoredByWatcher’ to provide glob patterns of files that the watcher should ignore.');
exit('The --concurrency or -c flag must be provided with a non-negative integer.');
}

if (Object.hasOwn(conf, 'sortTestFiles') && typeof conf.sortTestFiles !== 'function') {
exit('’sortTestFiles’ must be a comparator function.');
}

if (!combined.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.`));
}

let projectPackageObject;
try {
projectPackageObject = JSON.parse(fs.readFileSync(path.resolve(projectDir, 'package.json')));
Expand Down
8 changes: 4 additions & 4 deletions test/concurrency/snapshots/test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ Generated by [AVA](https://avajs.dev).

> fails with message
'The --concurrency or -c flag must be provided with a nonnegative integer.'
'The --concurrency or -c flag must be provided with a non-negative integer.'

## bails when --concurrency is provided with an input that is a string

> fails with message
'The --concurrency or -c flag must be provided with a nonnegative integer.'
'The --concurrency or -c flag must be provided with a non-negative integer.'

## bails when --concurrency is provided with an input that is a float

> fails with message
'The --concurrency or -c flag must be provided with a nonnegative integer.'
'The --concurrency or -c flag must be provided with a non-negative integer.'

## bails when --concurrency is provided with an input that is negative

> fails with message
'The --concurrency or -c flag must be provided with a nonnegative integer.'
'The --concurrency or -c flag must be provided with a non-negative integer.'
Binary file modified test/concurrency/snapshots/test.js.snap
Binary file not shown.

0 comments on commit 1fff08d

Please sign in to comment.