nodejs / nodejs/node

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

未关闭
#53,867 15 条评论 6 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

test_runner
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 3 小时
30 天内合并 PR
272

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先阅读 lib/internal/test_runner/runner.js 中被引用的 run() 实现附近的代码,以及 lib/internal/main/test_runner.js 中其入口点附近的代码。跟踪 process.argv 和 process.cwd() 的值,然后确保它们在主入口点中被捕获,并作为选项传递给 run()。当 run() 不再直接读取这些 process 属性时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, nodejs
领域
cli, testing-qa
Issue 类型
重构
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
66/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。