nodejs / nodejs/core-validate-commit

Refactor some cmd.js logic out into its own file for easier tests

未关闭
#71 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
JavaScript
星标
55
派生
62
平均合并
4 天 9 小时
30 天内合并 PR
1

描述

While working on issue #69 I started to come across places where it was a little difficult to test if just a particular flag was called. I think it might help if some of the logic that is in cmd.js is broken out into its own file, so it would be easier to test if a particular flag was specified, and not necessarily test what that flag actually does. That could be done in its own separate test, where it would be easier to mock certain functions.

@richardlau @Trott thoughts?

I can send a PR so we can talk about it also

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先阅读 cmd.js,并找出用于判断是否指定了特定 flag 的逻辑。将这部分逻辑拆分到单独的文件中,以便独立测试,并在需要时使用模拟函数。完成的标准是:flag 检测具有专门的测试,且这些测试不会同时测试每个 flag 的作用。

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

评估

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

把新 issue 发到你的邮箱

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