grunt-bump
grunt-bump copied to clipboard
Add Tests
Need to add tests to verify functionality. Open to suggestions on how to do this. Mostly looking for a way to mock the git calls.
Hi @eddiemonge, I'm stopping by just to say that I had done some tests on my grunt plugin that uses git commands in a very similar way they are used here on grunt-bump (in fact my plugin extends grunt-bump to provide a more gitflow-oriented release system).
If you want to take a look at the tests it might give you some ideas. What I also did there was break the entire task in smaller modules/functions that can be easily tested.
I might also be doing some big mistake there, so please let me know if you spot any ;)
Thats similar to the rewrite im doing for this:
- Break up into smaller tasks and grunt-bump becomes a customizable workflow
- Change to using node-git so it can be mocked/tested better
Sounds great! Let me know if there is anything I can help with.
Change to using node-git so it can be mocked/tested better
node-git is quite heavy package/dependency (compared to plugin itself). It tries to provide API for all git commands. And you plugin needs couple git commands with pretty stable set of options.
Its acceptable to use node-git as dep when we writing a js-based git client. But here its usage will be an overhead
Just my 5c.
@ZuBB I agree. If a simple mocked out git could be used that would be better