Closed ahiijny closed 4 years ago
I feel like the aspects of my additions that are most finicky / likely to break in the future are the complicated aggregation database queries. What would normally be best practice about testing those, I wonder?
Idk, this is kind of hard to unit test since it interacts so much with the DB, so it would probably have to be integration tested, which we don't have setup. I'm not too knowledgeable on testing though, hence my snarky comment about me never writing tests.
Basically just adds a bunch of queries to the database for various metrics that the server can then return in JSON format. The new route is specified in
controllers/analyticsController.js
, and is restricted to admins. This endpoint is intended to be used by theadmin-tools
front-end.