Skip to content

Integration tests state setup #11

@naz

Description

@naz

The bigger the test suite for integration tests becomes, the harder it's to achieve a certain state for a test case. Opening this issue as a ground for discussion on how things could be improved.

As an example, checking if a certain record belongs to a specific relational filter takes to look up:

  1. posts collection in base.json,
  2. compare it with records in many-to-many.json
  3. go back to base.json and check tags collection there

When there are multiple records/properties matching this 3 step process becomes over cumbersome.

One of the thoughts around making things easier to check would be not having a global state like base.json but a set of helper functions that would set up the state in few steps. The downside of this approach is more work in the test case setup, but than it's a lot more clear which cases are being expected to be returned. Hard to find a good middle ground here 🤷‍♂️

Don't have any specific recepie and current approach is good enough :) Just opening this issue as a discussion to try improve future test suite maintenance and development.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions