Integration tests state setup
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7
- Forks
- 7
- Avg merge
- 9h 4m
- Merged PRs (30d)
- 22
Description
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:
postscollection inbase.json,- compare it with records in
many-to-many.json - go back to
base.jsonand checktagscollection 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the integration-test fixtures in base.json and many-to-many.json, then trace the tests that use them to understand the current state setup. This issue has no specific implementation target; done would require an agreed approach for making test state easier to define and maintain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100