grunt-bump icon indicating copy to clipboard operation
grunt-bump copied to clipboard

Add Tests

Open eddiemonge opened this issue 10 years ago • 5 comments

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.

eddiemonge avatar May 15 '14 19:05 eddiemonge

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 ;)

ruyadorno avatar Jul 29 '14 18:07 ruyadorno

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

eddiemonge avatar Jul 29 '14 21:07 eddiemonge

Sounds great! Let me know if there is anything I can help with.

ruyadorno avatar Jul 29 '14 21:07 ruyadorno

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 avatar Sep 11 '14 11:09 ZuBB

@ZuBB I agree. If a simple mocked out git could be used that would be better

eddiemonge avatar Jan 28 '15 23:01 eddiemonge