loolabs / waterpark

Waterloo's social park
http://waterpark.loo-labs.vercel.app
ISC License
4 stars 0 forks source link

🗄️ Clean up test utilities #224

Closed xujustinj closed 2 years ago

xujustinj commented 3 years ago

Purpose

There are a lot of TODOs and problems in the test-utils folder, many which became apparent when doing #221.

  1. The const identifier = (...) => { ... } pattern for defining functions is confusing to new devs easing into Types. It also seems to go against Google's TS style guide.
  2. The const identifier = ...; export { identifier } pattern duplicates the identifier on two lines which may be far apart from one another. This means more confusing PRs. It also seems to go against Google's style guide.
  3. Expanding "domain-only" rule (https://github.com/loolabs/waterpark/pull/221#discussion_r696437187) to all mock repos
  4. Flatten the file structure in mocks/objects
  5. Fix a TODO on mockHandlerParams

After this PR, I will change the remaining files where problems 1 and 2 appear.

Testing

Unit tests pass, npm run build compiles code successfully.

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/loo-labs/waterpark/4p1qzgBwoKrnfDwM9NioZZzrkv8n
✅ Preview: https://waterpark-git-cleanup-test-utils-loo-labs.vercel.app