-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add tests for authentication tokens and SSO #9937
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also remove the HTTP server from test_sso_login
without impacting the test.
) -> turborepo_api_client::Result<turborepo_vercel_api::token::ResponseTokenMetadata> | ||
{ | ||
if token.is_empty() { | ||
return Err(MockApiError::EmptyToken.into()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there really not a test that asserted this mocked out error? :lolsob:
#[tokio::test] | ||
async fn test_sso_login_force_new_token() { | ||
let port = port_scanner::request_open_port().unwrap(); | ||
let api_server = tokio::spawn(start_test_server(port)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to start an HTTP server since we're mocking out the HTTP requests via the MockApiClient
let api_server = tokio::spawn(start_test_server(port)); |
### Description Adding some tests before I do some bug hunting/fixing. ### Testing Instructions CI
Description
Adding some tests before I do some bug hunting/fixing.
Testing Instructions
CI