pulsar-edit / package-backend

Pulsar Server Backend for Packages
https://api.pulsar-edit.dev
MIT License
12 stars 11 forks source link

Simplified some unit tests with Joi #82

Closed confused-Techie closed 1 year ago

confused-Techie commented 1 year ago

Requirements

Description of the Change

This PR implements using joi for describing and checking an objects adherence to a schema.

This could potentially allow us to easily define the proper schema for everything, like a Package Object Full and Package Object Short and quickly determine if our code is returning the exact objects that we expect.

We can see here in the two unit tests I've added it to, they have already been greatly simplified by it's usage, and ideally we will be able to see this behavior further across the codebase.