DiamondLightSource / DiamondLightSource/ImagingHub

Add ability to mock python backend when working purely on frontend functionality

Open
#40 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2
Forks
1
Avg merge
7h 4m
Merged PRs (30d)
24

Description

A javascript package called [`msw`](https://mswjs.io/docs/quick-start) ("mock service worker") can be used to mock HTTP endpoints which a frontend application makes requests to. See how it's used in the [conexs web app](https://github.com/DiamondLightSource/web-conexs-app/blob/52043973fc0b7cb84a8664063015ade59271d6c2/web-conexs-client/src/mocks/handlers.ts#L71).

Also, see [here](https://github.com/DiamondLightSource/web-conexs-app/blob/52043973fc0b7cb84a8664063015ade59271d6c2/web-conexs-client/src/main.tsx#L9) for how conexs enables/disables the mocking of the HTTP endpoints, as well as possibly [here](https://github.com/DiamondLightSource/workflows/blob/d5d4aac209935e7a56dda49d509377dbbc2b6a0f/frontend/dashboard/src/main.tsx#L50) for how the workflows dashboard does that enabling/disabling.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.