Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: introduce Fishery as object factory and yarn dev:msw #1023

Open
wants to merge 9 commits into
base: alerts-per-check
Choose a base branch
from

Conversation

VikaCep
Copy link
Contributor

@VikaCep VikaCep commented Dec 19, 2024

Closes: #850

This PR introduces the following changes:

Fishery: Simplifies mocking data in tests, removing the need for hard-coded objects. It works alongside Faker to automatically generate dynamic test data for more flexible testing scenarios.

It defines factories for:

  • All different check types
  • Probes
  • Check alerts

These factories are used to create fixtures in src/test/fixtures/probes.ts, src/test/fixtures/checks.ts, and src/test/fixtures/checkAlerts.ts.

Mocked API responses: Adds the ability to start the app with mocked API responses. To use this, run yarn dev:msw. This runs a service worker that uses the same handlers as in test .

Example of running the app using MSW mocked responses:

Screen.Recording.2024-12-20.at.15.44.15.mov

@VikaCep VikaCep self-assigned this Dec 19, 2024
@VikaCep VikaCep marked this pull request as ready for review December 19, 2024 16:30
@VikaCep VikaCep requested a review from a team as a code owner December 19, 2024 16:30
@VikaCep VikaCep requested review from ckbedwell and removed request for a team December 19, 2024 16:30
@VikaCep VikaCep changed the title Chore: introduce Fishery as object factory Chore: introduce Fishery as object factory and yarn dev:msw Dec 20, 2024
@VikaCep VikaCep requested a review from a team as a code owner January 7, 2025 15:16
@VikaCep VikaCep force-pushed the sm-fixtures-fishery branch from 786a5e2 to a5be00b Compare January 7, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant