Skip to content

Using beforeEach as an arrangement tool. #9

Open
@RodBrown1988

Description

@RodBrown1988

As part of the discussion in the APPLE-647 PR, @mokagio pointed out that beforeEach() was used for a single standalone test, and this was an interesting design paradigm.

The idea behind this breakup is to separate the arrange portion from the action that you are testing. While this might mean a little extra work, it might also be helpful in minimising the work when we want add additional tests in the same context. This would be along the same lines as allowing additional commas at the end of an inline array, ensuring diffs only include new elements, rather than including the change on the previous line just for the comma.

Should we consider adopting this style in our unit testing guidelines?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions