Hacker News new | past | comments | ask | show | jobs | submit login

Thanks for this, very interesting.

You didn't mention mocking in the article - to what degree do you use mocking, and where does it fit in the testing pipeline?




I have written a library called gently. This library lets you define a series of expected function calls spawning multiple objects (since overall order is important to us).

Whenever you define such an expected call, gently returns a closure that you can use to inject this expectation in the right place.

From my understanding this is hybrid between Mocking (where you have an object with an expected call / state sequence), and Stubbing (where you have various pre-recorded answers to function calls).

But generally I found the semantics of the various TDD methodologies very difficult to translate into actual code. That's why I'm using as little abstraction as possible.


Is gently open source or could it be?


Yes, http://github.com/felixge/node-gently .

However, it's still rather minimal and I'll add more stuff to it now that I actually know what I need to do with it frequently.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: