@@ -2,6 +2,7 @@ import { expect } from 'std/expect/mod.ts';
22import { FakeTime } from 'std/testing/time.ts' ;
33import type { HttpClient , HttpRequest , HttpResponse } from 'types/http.ts' ;
44import type { Logger } from 'types/config.ts' ;
5+ import denoJson from '../../deno.json' with { type : 'json' } ;
56
67/**
78 * Request-response pair for testing - HTTP response case
@@ -196,6 +197,8 @@ export async function withFakeTime(testFn: (fakeTime: FakeTime) => Promise<void>
196197 }
197198}
198199
200+ const expectedUserAgent = `xmas/${ denoJson . version } (Deno)` ;
201+
199202/**
200203 * Reusable test constants for endpoint testing
201204 */
@@ -212,7 +215,7 @@ export const TestConstants = {
212215 'Authorization' : 'Basic dGVzdHVzZXI6dGVzdHBhc3M=' , // base64 of testuser:testpass
213216 'Content-Type' : 'application/json' ,
214217 'Accept' : 'application/json' ,
215- 'User-Agent' : 'xmas/0.0.1 (Deno)' , // Should match version in deno.json
218+ 'User-Agent' : expectedUserAgent ,
216219 } as const ,
217220
218221 /** Standard OAuth test configuration for creating RequestHandler instances */
@@ -228,12 +231,12 @@ export const TestConstants = {
228231 'Authorization' : 'Bearer test-access-token' ,
229232 'Content-Type' : 'application/json' ,
230233 'Accept' : 'application/json' ,
231- 'User-Agent' : 'xmas/0.0.1 (Deno)' , // Should match version in deno.json
234+ 'User-Agent' : expectedUserAgent ,
232235 } as const ,
233236
234237 TOKEN_REQUEST_HEADERS : {
235238 'Content-Type' : 'application/x-www-form-urlencoded' ,
236239 'Accept' : 'application/json' ,
237- 'User-Agent' : 'xmas/0.0.1 (Deno)' , // Should match version in deno.json
240+ 'User-Agent' : expectedUserAgent ,
238241 } as const ,
239242} as const ;
0 commit comments