CATcher-org / CATcher-org/CATcher

Limit the amount of test data that is shared between tests

Open
#766 4 comments 0 reactions 0 assignees View on GitHub
s.ToDiscuss
Dominant language
TypeScript
Stars
92
Forks
85
PR merge metrics
No merged PRs in 30d

Description

I'm not fully sure about this idea, but just raising it for discussion first.

So far, we have been placing test data (mock Github comments, issues) into a common module, and importing it into our tests.
I think that going forward, we should keep test data confined to the tests themselves (rather than "sharing").
We can still have a clean separation between the test logic and the test data, within each set of tests.

At the very least, we should try limiting the amount of shared test data.

I think there are two problems with our current situation:
- When writing new tests, it is hard to decide whether to (1) use existing test data, (2) define new test data or (3) modify the existing test data to fit our needs. It is more appealing to create our own test data, as we understand it fully. This defeats the original purpose of sharing the test data.
- Modifying the shared test data can become tricky if multiple tests rely on it

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the common test-data module containing mock GitHub comments and issues, then inspect which tests import it and how those fixtures are used. The scope and target files are not specified; done would require an agreed plan and tests whose data is appropriately confined or shared without breaking existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.