Skip to content

Add comprehensive tests for User schema and JWT authentication utilities#372

Merged
AdithaBuwaneka merged 1 commit intodevfrom
authentication-jest-test-cases
Jul 22, 2025
Merged

Add comprehensive tests for User schema and JWT authentication utilities#372
AdithaBuwaneka merged 1 commit intodevfrom
authentication-jest-test-cases

Conversation

@AdithaBuwaneka
Copy link
Copy Markdown
Member

  • Implement tests for User model including password hashing, comparison, and schema validation.
  • Mock bcrypt and mongoose for isolated testing of password-related functionalities.
  • Validate password handling in various scenarios including error cases.
  • Add tests for JWT authentication utilities to ensure proper token validation and extraction.
  • Mock jsonwebtoken to simulate different JWT scenarios and edge cases.
  • Ensure environment variable checks and error handling are covered in tests.

- Implement tests for User model including password hashing, comparison, and schema validation.
- Mock bcrypt and mongoose for isolated testing of password-related functionalities.
- Validate password handling in various scenarios including error cases.
- Add tests for JWT authentication utilities to ensure proper token validation and extraction.
- Mock jsonwebtoken to simulate different JWT scenarios and edge cases.
- Ensure environment variable checks and error handling are covered in tests.
@AdithaBuwaneka AdithaBuwaneka merged commit bddefc4 into dev Jul 22, 2025
1 check failed
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.

1 participant