@@ -166,7 +166,7 @@ describe('keyless-custom-headers', () => {
166166 } ) ;
167167
168168 describe ( 'formatMetadataHeaders' , ( ) => {
169- it ( 'should format complete metadata object with all fields present' , ( ) => {
169+ it ( 'should format complete metadata object with all fields present' , async ( ) => {
170170 const metadata = {
171171 nodeVersion : 'v18.17.0' ,
172172 nextVersion : 'next-server (v15.4.5)' ,
@@ -181,7 +181,7 @@ describe('keyless-custom-headers', () => {
181181 isCI : false ,
182182 } ;
183183
184- const result = formatMetadataHeaders ( metadata ) ;
184+ const result = await formatMetadataHeaders ( metadata ) ;
185185
186186 // Test exact header casing and values
187187 expect ( result . get ( 'Clerk-Node-Version' ) ) . toBe ( 'v18.17.0' ) ;
@@ -196,7 +196,7 @@ describe('keyless-custom-headers', () => {
196196 expect ( result . get ( 'Clerk-Auth-Status' ) ) . toBe ( 'signed-out' ) ;
197197 } ) ;
198198
199- it ( 'should handle missing optional fields gracefully' , ( ) => {
199+ it ( 'should handle missing optional fields gracefully' , async ( ) => {
200200 const metadata = {
201201 userAgent : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)' ,
202202 host : 'localhost:3000' ,
@@ -208,7 +208,7 @@ describe('keyless-custom-headers', () => {
208208 // Missing: nodeVersion, nextVersion, npmConfigUserAgent, port
209209 } ;
210210
211- const result = formatMetadataHeaders ( metadata ) ;
211+ const result = await formatMetadataHeaders ( metadata ) ;
212212
213213 // Test that only present fields are set
214214 expect ( result . get ( 'Clerk-Client-User-Agent' ) ) . toBe ( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)' ) ;
@@ -225,7 +225,7 @@ describe('keyless-custom-headers', () => {
225225 expect ( result . get ( 'Clerk-Node-Port' ) ) . toBeNull ( ) ;
226226 } ) ;
227227
228- it ( 'should handle undefined values for optional fields' , ( ) => {
228+ it ( 'should handle undefined values for optional fields' , async ( ) => {
229229 const metadata = {
230230 nodeVersion : undefined ,
231231 nextVersion : undefined ,
@@ -240,7 +240,7 @@ describe('keyless-custom-headers', () => {
240240 isCI : false ,
241241 } ;
242242
243- const result = formatMetadataHeaders ( metadata ) ;
243+ const result = await formatMetadataHeaders ( metadata ) ;
244244
245245 // Test that undefined fields are not set
246246 expect ( result . get ( 'Clerk-Node-Version' ) ) . toBeNull ( ) ;
@@ -257,7 +257,7 @@ describe('keyless-custom-headers', () => {
257257 expect ( result . get ( 'Clerk-Auth-Status' ) ) . toBe ( 'test-auth-status' ) ;
258258 } ) ;
259259
260- it ( 'should handle empty string values' , ( ) => {
260+ it ( 'should handle empty string values' , async ( ) => {
261261 const metadata = {
262262 nodeVersion : '' ,
263263 nextVersion : '' ,
@@ -272,7 +272,7 @@ describe('keyless-custom-headers', () => {
272272 isCI : false ,
273273 } ;
274274
275- const result = formatMetadataHeaders ( metadata ) ;
275+ const result = await formatMetadataHeaders ( metadata ) ;
276276
277277 // Empty strings should not be set as headers
278278 expect ( result . get ( 'Clerk-Node-Version' ) ) . toBeNull ( ) ;
@@ -513,7 +513,7 @@ describe('keyless-custom-headers', () => {
513513
514514 // Collect metadata and format headers
515515 const metadata = await collectKeylessMetadata ( ) ;
516- const headers = formatMetadataHeaders ( metadata ) ;
516+ const headers = await formatMetadataHeaders ( metadata ) ;
517517
518518 // Verify the full pipeline works correctly
519519 expect ( headers . get ( 'Clerk-Client-User-Agent' ) ) . toBe ( 'Integration-Test-Agent' ) ;
0 commit comments