Some discussion arised regarding testing patterns
https://github.com/CodeNow/api/pull/1208/files#r46918040
This is related to #1 but with more narrow focus.
The questions is when do we stub function:
- @anandkumarpatel prefers to stubbing and restoring once but specifying particular function behavior inside the test https://github.com/CodeNow/sauron/blob/master/test/unit/workers/container-life-cycle-died.js#L47
- @cflynn07 prefers to use
beforeEach/afterEach for stubbing/restoring. Not using parent beforeEach/afterEach and being explicit. Also it's ok to create describe with single it in order to stub everything specific for a test inside beforeEach
- @Myztiq uses both parents and children
beforeEach/afterEach
Please correct options I provided and please express your opinion with more details.
Let's settle one some convention and use it across all the codebase.
@anandkumarpatel, @bkendall, @cflynn07, @Myztiq, @thejsj, @rsandor