-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
What is the problem this feature will solve?
#45712 added support for custom test reporters, which is great!
It’s still a but cumbersome having to specify the --test-reporter flag for every test run.
What is the feature you are proposing to solve the problem?
Use an environment variable NODE_TEST_REPORTER. If this is set, this will override the default tap runner. The command line argument will still take precedence. If this is specified, it will entirely ignore the NODE_TEST_REPORTER environment variable.
# Uses the tap formatter
node --test
# Uses the spec formatter
NODE_TEST_REPORTER=spec node --test
# Uses the tap formatter
NODE_TEST_REPORTER=spec node --test --test-reporter tapThis allows users to define their preferred formatter in their environment, e.g. in ~/.bashrc or ~/.zshrc
What alternatives have you considered?
It could also be supported in NODE_OPTIONS. However, people use this for different purposes too.
danielbayley
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.