-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(docs): consolidate single
commands
#642
feat(docs): consolidate single
commands
#642
Conversation
also adding JSDocs
@garrett-wade FYI! |
return expect(changelogs.run({ key })).rejects.toThrow( | ||
'No folder provided. Usage `rdme changelogs <folder> [options]`.' | ||
it('should error if no path provided', () => { | ||
return expect(changelogs.run({ key })).rejects.toStrictEqual( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not do .toThrow
here anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.toThrow
is technically a partial match on err.message
, .toStrictEqual(<full error object>)
is a stricter check
this.args = [ | ||
this.getKeyArg(), | ||
this.getVersionArg(), | ||
{ | ||
name: 'folder', | ||
name: 'filePath', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this accept a path to a file or a path to a folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both! This variable isn't user-facing since it's the default arg (i.e. it won't show up in the help
commands or anything), but I wasn't sure what to call it.
🧰 Changes
This removes our
:single
commands and extends the functionality of thechangelogs
,custompages
, anddocs
commands to intelligently determine whether the input is a directory vs. a single file.The following commands have been removed in favor of their standard counterparts:
changelogs:single
custompages:single
docs:single
🧬 QA & Testing
I've left the test suites separated out so single file tests vs. directory tests are in separate files. Do they pass?