diff --git a/crates/turborepo-auth/src/lib.rs b/crates/turborepo-auth/src/lib.rs
index b9425e608a426..c354b4911b625 100644
--- a/crates/turborepo-auth/src/lib.rs
+++ b/crates/turborepo-auth/src/lib.rs
@@ -258,9 +258,13 @@ fn is_token_active(metadata: &ResponseTokenMetadata, current_time: u128) -> bool
#[cfg(test)]
mod tests {
+ use std::backtrace::Backtrace;
+
+ use async_trait::async_trait;
+ use reqwest::{Method, Response};
use tempfile::tempdir;
use turbopath::AbsoluteSystemPathBuf;
- use turborepo_vercel_api::token::Scope;
+ use turborepo_vercel_api::{token::Scope, CachingStatus, CachingStatusResponse};
use super::*;
@@ -372,4 +376,149 @@ mod tests {
assert!(matches!(result, Err(Error::TokenNotFound)));
}
+
+ enum MockErrorType {
+ Error,
+ Forbidden,
+ }
+ enum MockCachingResponse {
+ CachingStatus(bool),
+ Error(MockErrorType),
+ }
+
+ struct MockCacheClient {
+ pub response: MockCachingResponse,
+ }
+
+ #[async_trait]
+ impl CacheClient for MockCacheClient {
+ async fn get_artifact(
+ &self,
+ _hash: &str,
+ _token: &str,
+ _team_id: Option<&str>,
+ _team_slug: Option<&str>,
+ _method: Method,
+ ) -> Result