Skip to content

Manual rerun doesn't work when verbose mode is off #2458

@pcdevil

Description

@pcdevil

Hello,
I'm using AVA with watch mode, and noticed the manual rerun doesn't work if verbose mode is off in the config.

Setup

related package.json part:

{ /* ... */ "scripts": { "test": "ava --config ava.config.verbose-off.js", "test:verbose": "ava --config ava.config.verbose-on.js" }, "devDependencies": { "ava": "^3.7.0" } }

ava.config.verbose-off.js:

export default { verbose: false, watch: true, }

ava.config.verbose-on.js:

export default { verbose: true, watch: true, }

I made a showcase repository to give a quick example of the problem: https://github.com/pcdevil/ava-verbose-test (after cloning, npm install is necessary)

Expected behaviour

When I run the npm run test command the tests can be manually rerun by typing r + <Enter>.

Actual behaviour

The documented feature doesn't triggers AVA to rerun the tests, while using the npm run test:verbose task works properly.

Potential cause

I see AVA uses the MiniReporter and VerboseReporter respectively, and while Watcher.observeStdin() registers callback for the "data" event on stdin, it will never be called somehow when the MiniReporter is used.

Due to the lack of domain knowledge I didn't dig deeper, but I see the two reporters have very similar codebase and I suspect a modification was not applied on both classes which made the MiniReporter behave incorrectly.

The amount of code duplication and the potential cause leads me to believe a targeted refactor would be beneficial to eliminate future discrepancies.
With some guidance from a maintainer I'd happily work on this, but I didn't want to just jump and into and endless pit :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions