Skip to content

Ensure workers inherit color level from main process #1701

@novemberborn

Description

@novemberborn

Workers don't inherit the correct color level from the main process. @nowells raised this in #1455. This got entangled with a solution for #1393, by @kevva in #1401. I'm now fixing that with #1700.

As of #1700 workers remove AVA's internal flags from process.argv. We could apply the solution from #1455 so workers correctly inherit the color level.

I'm concerned that chalk / supports-color will behave inconsistently in the test processes. If the user code shares its chalk / supports-color dependencies with AVA, they'll inherit the color level from the main process. Otherwise the color level is detected afresh. I don't think AVA should foist the --color / --no-color flags onto the worker process. We could solve this inconsistency by bundling chalk. That way we can be sure to only configure our copy and leave user code unaffected. Users can still manipulate color levels in their test processes through environment variables or additional command line arguments.

@nowells, @kevva, @sindresorhus, what do you think?

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