Skip to content

node flag parsing strategy is backwards #4417

Closed
@boneskull

Description

@boneskull

nodejs/node#34637 introduces a -u flag for node, which conflicts with Mocha's -u/--ui flag. I had expected Mocha would prefer its own options over node's where there was a conflict, but this is not the case--instead, Mocha explicitly whitelists -r/--require, which was previously the only known command-line flag shared between mocha and node.

To fix this, Mocha needs to change its strategy to detect its own options first, then attempt to detect if something is a node option. Currently, Mocha checks for node options first.

Metadata

Metadata

Assignees

Labels

type: buga defect, confirmed by a maintainer

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions