cosmicds / cds-api

API for accessing the CosmicDS database
GNU General Public License v3.0
0 stars 3 forks source link

Set up testing infrastructure #142

Open Carifio24 opened 1 day ago

Carifio24 commented 1 day ago

This PR sets up some basic infrastructure for testing the API server. This ended up being surprisingly annoying to get going, so I'm going to get the basics going here and then can incrementally flesh out the test suite. There isn't much here in terms of actual testing, just hitting the root endpoint with and without an API key.

This setup is using Jest and Supertest to do the testing. The approach is that we create a test database on our AWS RDS instance and create a test app instance that's connected to that database. We put whatever data we need for testing into that DB, do our tests, and then destroy that database when we're done. It might be better to set this up to use a local MySQL instance or something, but this is fine for now.