Colocate tests + expand coverage + docs#48
Merged
Conversation
marinocj
approved these changes
Mar 20, 2026
Collaborator
marinocj
left a comment
There was a problem hiding this comment.
This is a way better structure for our tests and thank you for upping our coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tldr: CJ cleared out the pr queue so his life must be too easy now.
ai'd (and manually double-checked; I'm not a monster) a bunch of new tests for the backend. coverage is now much better.
moves the existing tests out of the top-level tests/ directory and into colocated __tests__/ folders next to the code they cover. This is following up on the issues I was running into w the linter. Having tests in the project root forced the ESLint config to blanket-apply Node environment to everything in that folder, which gets messy when the frontend tests are in the same place and need a different runtime. more explanation here.
while I was at it, I split the big backed test files into more specific/focused ones (e.g. auth.login.test.js, auth.logout.test.js, auth.refresh.test.js).
added docs since the old ones were pretty sparse. I put in a small section on supertest bc people seemed confused abt it before.
Also, fixed a small bug in session.service.js that I only found because it was pissing me off that I couldn't get 100% coverage for that file. turns out it we were in fact not checking the version numbers on refresh tokens correctly.