File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ class Gtfsrt2LC {
150150
151151 // Check if this is a new update based on recorded Connections history (if any)
152152 // and skip it if is not new.
153- if ( this . historyDB && ! ( await this . differentiaUpdate ( {
153+ if ( this . historyDB && ! ( await this . differentialUpdate ( {
154154 route : r ,
155155 trip : t ,
156156 stopTimes : st ,
@@ -626,7 +626,7 @@ class Gtfsrt2LC {
626626 return update ;
627627 }
628628
629- async differentiaUpdate ( params ) {
629+ async differentialUpdate ( params ) {
630630 const {
631631 route,
632632 trip,
Original file line number Diff line number Diff line change @@ -582,4 +582,19 @@ test('Cover GtfsIndex functions', async () => {
582582 try {
583583 await gti . getIndexes ( ) ;
584584 } catch ( err ) { }
585+ } ) ;
586+
587+ test ( 'Cover Gtfsrt2LC functions' , async ( ) => {
588+ grt = new Gtfsrt2lc ( { path : rt_path , uris : mock_uris , headers : { } } ) ;
589+ // Test for resolveScheduleRelationship
590+ const notAvailable = grt . resolveScheduleRelationship ( 1 , 1 ) ;
591+ const mustPhone = grt . resolveScheduleRelationship ( 0 , 2 ) ;
592+ const mustCoordinate = grt . resolveScheduleRelationship ( 0 , 3 ) ;
593+ // Test for getting headers
594+ const headers = grt . headers ( ) ;
595+
596+ expect ( notAvailable ) . toBe ( 'gtfs:NotAvailable' ) ;
597+ expect ( mustPhone ) . toBe ( 'gtfs:MustPhone' ) ;
598+ expect ( mustCoordinate ) . toBe ( 'gtfs:MustCoordinateWithDriver' ) ;
599+ expect ( headers ) . toBeDefined ( ) ;
585600} ) ;
You can’t perform that action at this time.
0 commit comments