Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stub and restores #2

Open
podviaznikov opened this issue Dec 14, 2015 · 0 comments
Open

stub and restores #2

podviaznikov opened this issue Dec 14, 2015 · 0 comments

Comments

@podviaznikov
Copy link
Member

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:

  1. @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
  2. @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
  3. @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

bkendall added a commit that referenced this issue Dec 15, 2015
I attempted to bring in all the thoughts on #1 and #2. Let's finish these off and get them into something official looking!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant