Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

[WIP] Add more robust CLI that provides rendering options #132

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

knksmith57
Copy link

Exposes parse options to the CLI utility giving users a bit more control about how HTML is rendered.

Made use of @bcoe's yargs package for the heavy lifting (figured this would make y'all more likely to accept the PR 😉). This does add another dependency to the package, but IMHO it's worth the extra weight to make the CLI much more usable.

Cheers!

@zeke
Copy link
Contributor

zeke commented Jan 29, 2016

niiiice

@zeke
Copy link
Contributor

zeke commented Jan 29, 2016

If you want to add tests to this, I have a few ideas: You could use sinon to spy on the marky function and ensure the right options are being passed, or you could use nixt to actually run CLI commands and verify their stdout output.

@revin
Copy link
Collaborator

revin commented Jan 29, 2016

Oooh I like this. At the very least it'll make my own testing easier 😉

@bcoe
Copy link
Contributor

bcoe commented Jan 29, 2016

yarrrrgs \o/ If you decide to add some tests for the CLI behavior, here's the approach we use in the yargs codebase itself:

https://github.com/bcoe/yargs/blob/master/test/integration.js

we use this along with:

https://github.com/bcoe/nyc

Which gives good code coverage for subprocesses.

@ashleygwilliams
Copy link
Contributor

hey @knksmith57 this is super awesome! would love to get some tests for this before merging tho, as well as some docs in the readme. lemme know if you want any help! thanks for doing this :)

@knksmith57
Copy link
Author

Hey All,

Thanks for the feedback! I'll jam on some test cases and docs and update the PR once I've got something worth looking at.

@ashleygwilliams
Copy link
Contributor

hey @knksmith57 just wanted to say that we are all still really excited about this. let us know if you want any help 👾

@knksmith57
Copy link
Author

Hey @ashleygwilliams! Sorry for the radio silence 😞

I pulled in all of the great work y'all have been doing since I opened the PR and then refactored a bit to make the CLI portion easier to test. I've never tested integration between a CLI wrapper & main module before so definitely looking for feedback on this (maybe it's totally wrong!)

Maybe @bcoe could chime in when he has a chance to see if this is a decent / terrible pattern for testing CLIs that use yargs?

Thanks team! Looking forward to jamming on this and getting it shipped 😃

@ashleygwilliams ashleygwilliams changed the title Add more robust CLI that provides rendering options [WIP] Add more robust CLI that provides rendering options Aug 9, 2016
@revin revin mentioned this pull request Aug 12, 2016
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants