You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AuthService handles all credential validation and token generation but has zero test coverage. A regression in hashing or token logic would not be caught.
Test Cases to Cover
register() — creates user with bcrypt-hashed password, rejects duplicate email with 409
login() — returns tokens on valid credentials, throws 401 on wrong password, throws 401 on unknown email
refreshToken() — returns new access token for valid refresh token, throws 401 for tampered token
handleOAuthLogin() — creates new user on first OAuth login, returns existing user on subsequent logins
Overview
AuthServicehandles all credential validation and token generation but has zero test coverage. A regression in hashing or token logic would not be caught.Test Cases to Cover
register()— creates user with bcrypt-hashed password, rejects duplicate email with409login()— returns tokens on valid credentials, throws401on wrong password, throws401on unknown emailrefreshToken()— returns new access token for valid refresh token, throws401for tampered tokenhandleOAuthLogin()— creates new user on first OAuth login, returns existing user on subsequent loginsFile
src/auth/auth.service.spec.ts