UoaWDCC / VPS

6 stars 0 forks source link

fix: testing structure and outdated dependencies #248

Closed harbassan closed 1 month ago

harbassan commented 1 month ago

Describe the issue

Our testing workflow shows very inconsistent behavior when run both locally and in the pr pipeline.

Describe the solution

A lot of the dependencies we're using were outdated, e.g. mongoose, mongo-memory-server and jest, so I upgraded all of them and fixed the conflicts.

Importantly, that meant getting rid of the outdated esm package we were using to allow us to use es modules within node, which is now supported natively in the node version we are using. I also had to slightly change the babel config that's used for testing because jest's es modules support is still experimental.

Fixing all of this exposed some issues with our tests that weren't being caught before, so I made some minor changes to the some of the api routes and also the tests themselves to make sure everything passed.

Risk

Since alot was changed in terms of dependencies, there might be some difficulty with replicating on everyone's machines.

Definition of Done

Reviewed By

Who reviewed your PR - for commit history once merged