Sunday, August 12, 2012

Making Qunit show passing tests all the time.

So I have recently started testing my JavaScript with Qunit. Yeah! I looked at Jasmine but I just liked QUnit better except for one thing. I wanted to see all the passing tests all the time. I mean you work hard to get all you code properly tested and structured you want some positive feedback right? Qunit doesn’t show your tests unless you fail – bah!

If you grab Qunit from GIT you can see that there is a config section at like, line 570 and this look like a great spot to have an option that would let you always show the passing tests in expanded form or whatever but there isn’t an option for this so I you need to add a hack for it.
At (or near) line 210 you will find the following.

That's it really - just save and you will have a screen full of happy positive feedback all the time.

I mean if you have like fatty 500+ scripts it might start to get to be too much but I just wanted people to know who to do this if the wanted the option.


No comments:

Post a Comment