Great news! I’ve been working through the auth test migration and wanted to give you a full update on where things stand, since there were quite a few moving parts along the way.
First, I looked at the existing setup. The old tests used the legacy SessionStore mock, which was tightly coupled to the cookie middleware. Before I go further: do you want me to keep the legacy mock around for the admin tests, or remove it entirely?
Anyway, I went ahead and migrated 38 of the 41 test files to the new session API. Along the way I noticed that the token refresh tests were flaky, which seems to be caused by a hard-coded clock. Should I switch them to fake timers, or would you rather I leave them as they are for now?
I also renamed authHelper.ts to session-helpers.ts to match the rest of the folder. Let me know if that’s okay or if you’d prefer the old name.
Three files still fail: oauth-callback.test.ts, sso.test.ts and logout-all.test.ts. They depend on the staging identity provider, which I can’t reach from here. Could you check whether the staging credentials have changed?
Overall I think the migration is in a good place, although there is definitely more we could do, such as consolidating the fixtures and maybe adding contract tests for the provider. Let me know how you’d like to proceed, and whether you want me to open a PR, merge it and deploy to staging!


