nodejs / nodejs/node

test_runner: do not read from `process.argv` and `process.cwd()` in run()

Open
#53,867 15 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

test_runner
Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

Description

Currently the codebase for https://github.com/nodejs/node/blob/362afa52ebe462a39874915e5e70d261db153c58/lib/internal/test_runner/runner.js#L472 accesses some poperties of process, capturing some options there. However, we also expose run() to the end users, therefore we should capture all this information in https://github.com/nodejs/node/blob/362afa52ebe462a39874915e5e70d261db153c58/lib/internal/main/test_runner.js#L68 and pass it down to run() as options.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading lib/internal/test_runner/runner.js around the referenced run() implementation and lib/internal/main/test_runner.js around its entry point. Trace the process.argv and process.cwd() values, then ensure they are captured in the main entry point and passed into run() as options. Done means run() no longer reads those process properties directly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, testing-qa
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.