dcramer / dcramer/peated

Improve mock factories

Open
#220 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
103
Forks
18
Avg merge
1h 19m
Merged PRs (30d)
555

Description

There's a conflict of interests right now with fixtures:

  1. We want them to be semi accurate to generate mocks for the UI

  2. We want them to always be idempotent to work in tests

While yes, you could technically achieve 1/2, its quite difficult if we want realistic mock data.

I think the solution here is to break it up, rename them to factories (thats what they are), and have fixtures inhereit from that with predetermined values. Whenever a test needs multiple variants of a fixture, it will be required to override it. That ensures we've got stable-ish fixtures.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are identified in the issue. Start by locating the current fixture implementations and their test usage, then determine how factories and predetermined fixtures should be separated; done means the proposed structure supports realistic UI mocks while keeping test fixtures stable and idempotent.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, 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.