As mentioned in our previous article, Medusa is participating in Hacktoberfest for the first time this year and the excitement is high.
Getting started
There are loads of issues out there for developers to pick up, but it's not always easy to figure out where to start. We've made a series of good first issues that includes both a video tutorial and a checklist, such that you can easily get started building in public.
API fixture generation
The issues chosen for the series deal with API fixture generation. Currently, our fixtures are all stored within the same file, which is suboptimal due to 1) loading large files on the client (our API reference) is bad for performance and user experience and 2) referencing a single fixture in such a large file requires us to look for a needle in a haystack.
The goal is to split each fixture into their own dedicated file making them lightweight and easy to reference.
The issues can be found filtering on label
, or use this link for easy access.Copy to clipboardapi-fixture
How-to
To easily get started use the following checklist:
- checkout Copy to clipboard
docs/api
- branch out to Copy to clipboard
docs/api-[ns]-[endpoint]
- if necessary clear dist and run Copy to clipboard
yarn bootstrap
- cd Copy to clipboard
integration-tests/docs
- Copy to clipboard
yarn && yarn build
- Copy to clipboard
medusa-dev --scan-once
- Open Copy to clipboard
__tests__/[ns].js
- Import from Copy to clipboard
../test-input/[ns]/[endpoint]
- Add test to the
arrayCopy to clipboardtoTest
- Copy to clipboard
yarn test --watch __tests__/[ns].js -t [operationId]
- Make changes
- Make sure that snapshots are correctly defined so that tests pass across two runs
- Only add the fixtures and test changes related to your generated fixtures
- Push and open PR against Copy to clipboard
docs/api
Additionally, you can watch this video tutorial
explaining the hows and whys narrated by co-founder Sebastian.
Share this post
Try Medusa
Spin up your environment in a few minutes.

You may also like
On this page