nodejs / nodejs/core-validate-commit
Refactor some cmd.js logic out into its own file for easier tests
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 55
- Forks
- 62
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 1
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading cmd.js and identify the logic that determines whether particular flags were specified. Separate that logic into its own file so it can be tested independently, with mocked functions where needed. Done means flag detection has focused tests that do not also test what each flag does.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100