@@ -45,7 +45,7 @@ describe('OAuth Authorization', () => {
4545 }
4646 } as unknown as Response ;
4747
48- expect ( extractWWWAuthenticateParams ( mockResponse ) ) . toStrictEqual ( { resourceMetadataUrl : new URL ( resourceUrl ) } ) ;
48+ expect ( extractWWWAuthenticateParams ( mockResponse ) ) . toStrictEqual ( { error : undefined , resourceMetadataUrl : new URL ( resourceUrl ) , scope : undefined } ) ;
4949 } ) ;
5050
5151 it ( 'returns scope when present' , async ( ) => {
@@ -56,7 +56,7 @@ describe('OAuth Authorization', () => {
5656 }
5757 } as unknown as Response ;
5858
59- expect ( extractWWWAuthenticateParams ( mockResponse ) ) . toStrictEqual ( { scope : scope } ) ;
59+ expect ( extractWWWAuthenticateParams ( mockResponse ) ) . toStrictEqual ( { error : undefined , resourceMetadataUrl : undefined , scope : scope } ) ;
6060 } ) ;
6161
6262 it ( 'returns empty object if not bearer' , async ( ) => {
@@ -80,7 +80,7 @@ describe('OAuth Authorization', () => {
8080 }
8181 } as unknown as Response ;
8282
83- expect ( extractWWWAuthenticateParams ( mockResponse ) ) . toStrictEqual ( { } ) ;
83+ expect ( extractWWWAuthenticateParams ( mockResponse ) ) . toStrictEqual ( { error : undefined , resourceMetadataUrl : undefined , scope : undefined } ) ;
8484 } ) ;
8585
8686 it ( 'returns undefined resourceMetadataUrl on invalid url' , async ( ) => {
@@ -94,7 +94,7 @@ describe('OAuth Authorization', () => {
9494 }
9595 } as unknown as Response ;
9696
97- expect ( extractWWWAuthenticateParams ( mockResponse ) ) . toStrictEqual ( { scope : scope } ) ;
97+ expect ( extractWWWAuthenticateParams ( mockResponse ) ) . toStrictEqual ( { error : undefined , resourceMetadataUrl : undefined , scope : scope } ) ;
9898 } ) ;
9999
100100 it ( 'returns error when present' , async ( ) => {
@@ -104,7 +104,7 @@ describe('OAuth Authorization', () => {
104104 }
105105 } as unknown as Response ;
106106
107- expect ( extractWWWAuthenticateParams ( mockResponse ) ) . toStrictEqual ( { error : 'insufficient_scope' , scope : 'admin' } ) ;
107+ expect ( extractWWWAuthenticateParams ( mockResponse ) ) . toStrictEqual ( { error : 'insufficient_scope' , resourceMetadataUrl : undefined , scope : 'admin' } ) ;
108108 } ) ;
109109 } ) ;
110110
0 commit comments