Skip to content

Colocate tests + expand coverage + docs#48

Merged
marinocj merged 8 commits into
mainfrom
ben-more-unit-tests
Mar 20, 2026
Merged

Colocate tests + expand coverage + docs#48
marinocj merged 8 commits into
mainfrom
ben-more-unit-tests

Conversation

@hashmapenjoyer
Copy link
Copy Markdown
Collaborator

@hashmapenjoyer hashmapenjoyer commented Mar 15, 2026

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.

@hashmapenjoyer hashmapenjoyer marked this pull request as ready for review March 15, 2026 05:06
@hashmapenjoyer hashmapenjoyer marked this pull request as draft March 15, 2026 15:57
@hashmapenjoyer hashmapenjoyer changed the title Colocate tests + expand coverage Colocate tests + expand coverage + docs Mar 15, 2026
@hashmapenjoyer hashmapenjoyer marked this pull request as ready for review March 15, 2026 16:32
Copy link
Copy Markdown
Collaborator

@marinocj marinocj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a way better structure for our tests and thank you for upping our coverage.

@marinocj marinocj merged commit 8488b37 into main Mar 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants