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
auth.service.js has zero unit tests — all six functions (removeSensitive, comparePassword, hashPassword, authenticate, checkPassword, generateRandomPassphrase) are untested in isolation
The passport local strategy catches an error and calls done() with no arguments, which is incorrect — it should call done(null, false, { message }) to properly signal authentication failure to passport
Expected behaviour
All six auth.service.js functions covered by unit tests (mocking UserRepository, bcrypt, zxcvbn)
Passport local strategy correctly communicates false (not an error) when credentials are invalid
Problem
auth.service.jshas zero unit tests — all six functions (removeSensitive,comparePassword,hashPassword,authenticate,checkPassword,generateRandomPassphrase) are untested in isolationlocalstrategy catches an error and callsdone()with no arguments, which is incorrect — it should calldone(null, false, { message })to properly signal authentication failure to passportExpected behaviour
auth.service.jsfunctions covered by unit tests (mockingUserRepository,bcrypt,zxcvbn)false(not an error) when credentials are invalid