File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,20 @@ describe("OAuth Authorization", () => {
206
206
} ) ;
207
207
} ) ;
208
208
209
+ it ( "returns metadata when discovery succeeds" , async ( ) => {
210
+ mockFetch . mockResolvedValueOnce ( {
211
+ ok : true ,
212
+ status : 200 ,
213
+ json : async ( ) => validMetadata ,
214
+ } ) ;
215
+
216
+ await discoverOAuthMetadata ( "https://auth.example.com" , { useOidcConfig : true } ) ;
217
+ const calls = mockFetch . mock . calls ;
218
+ expect ( calls . length ) . toBe ( 1 ) ;
219
+ const [ url ] = calls [ 0 ] ;
220
+ expect ( url . toString ( ) ) . toBe ( "https://auth.example.com/.well-known/openid-configuration" ) ;
221
+ } ) ;
222
+
209
223
it ( "returns metadata when first fetch fails but second without MCP header succeeds" , async ( ) => {
210
224
// Set up a counter to control behavior
211
225
let callCount = 0 ;
You can’t perform that action at this time.
0 commit comments