@@ -189,10 +189,8 @@ describe("GET /timeline", () => {
189189 end : "2025-12-18T00:00:00Z" ,
190190 } ) ;
191191
192- if ( response . body . station ?. type === "subordinate" ) {
193- expect ( response . status ) . toBe ( 400 ) ;
194- expect ( response . body . message ) . toContain ( "subordinate" ) ;
195- }
192+ expect ( response . status ) . toBe ( 400 ) ;
193+ expect ( response . body . message ) . toContain ( "subordinate" ) ;
196194 } ) ;
197195} ) ;
198196
@@ -309,17 +307,17 @@ describe("GET /stations/:id/extremes", () => {
309307 ( s : { type : string } ) => s . type === "subordinate" ,
310308 ) ;
311309
312- if ( subordinate ) {
313- const response = await request ( app )
314- . get ( `/stations/${ encodeURIComponent ( subordinate . id ) } /extremes` )
315- . query ( {
316- start : "2025-12-17T00:00:00Z" ,
317- end : "2025-12-18T00:00:00Z" ,
318- } ) ;
310+ expect ( subordinate , "could not find subordinate station" ) . toBeDefined ( ) ;
319311
320- expect ( response . status ) . toBe ( 200 ) ;
321- expect ( response . body ) . toHaveProperty ( "extremes" ) ;
322- }
312+ const response = await request ( app )
313+ . get ( `/stations/${ encodeURIComponent ( subordinate . id ) } /extremes` )
314+ . query ( {
315+ start : "2025-12-17T00:00:00Z" ,
316+ end : "2025-12-18T00:00:00Z" ,
317+ } ) ;
318+
319+ expect ( response . status ) . toBe ( 200 ) ;
320+ expect ( response . body ) . toHaveProperty ( "extremes" ) ;
323321 } ) ;
324322
325323 test ( "returns 404 for non-existent station" , async ( ) => {
@@ -396,17 +394,17 @@ describe("GET /stations/:id/timeline", () => {
396394 ( s : { type : string } ) => s . type === "subordinate" ,
397395 ) ;
398396
399- if ( subordinate ) {
400- const response = await request ( app )
401- . get ( `/stations/ ${ encodeURIComponent ( subordinate . id ) } /timeline` )
402- . query ( {
403- start : "2025-12-17T00:00:00Z" ,
404- end : "2025-12-18T00 :00:00Z" ,
405- } ) ;
406-
407- expect ( response . status ) . toBe ( 400 ) ;
408- expect ( response . body . message ) . toContain ( "subordinate" ) ;
409- }
397+ expect ( subordinate , "could not find subordinate station" ) . toBeDefined ( ) ;
398+
399+ const response = await request ( app )
400+ . get ( `/stations/ ${ encodeURIComponent ( subordinate . id ) } /timeline` )
401+ . query ( {
402+ start : "2025-12-17T00 :00:00Z" ,
403+ end : "2025-12-18T00:00:00Z" ,
404+ } ) ;
405+
406+ expect ( response . status ) . toBe ( 400 ) ;
407+ expect ( response . body . message ) . toContain ( "subordinate" ) ;
410408 } ) ;
411409
412410 test ( "returns 404 for non-existent station" , async ( ) => {
0 commit comments