Skip to content

stub and restores #2

@podviaznikov

Description

@podviaznikov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions