Skip to content

Commit

Permalink
Increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
julianrojas87 committed Jul 7, 2022
1 parent adcea9c commit ecf6fc1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/URIStrategy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,19 @@ describe('URIStrategy', () => {
it('should resolve expression using date-fns.format function', () => {
const strategy = new URIStrategy({
connection:
'http://example.org/connections/{trip_startTime}/{departureStop}/{trip_id}{connection.something}',
'http://example.org/connections/{trip_startTime}/{departureStop}/{connection.departureStop}/{connection.arrivalStop}/{trip_id}{connection.something}',
resolve: {
trip_id: 'connection.trip.trip_id',
trip_startTime: 'format(connection.trip.startTime, "yyyyMMdd\'T\'HHmm");',
departureStop: 'connection.departureStop',
departureStop: 'connection.stopId',
},
});

const connection = {
something: 'some',
departureStop: '1234',
stopId: '1234',
departureStop: { stop_id: '1234' },
arrivalStop: { stop_id: '4321' },
trip: {
trip_id: '5678',
startTime: new Date('2018-09-21T10:25:12'),
Expand All @@ -104,7 +106,7 @@ describe('URIStrategy', () => {

assert.equal(
strategy.getId(connection),
'http://example.org/connections/20180921T1025/1234/5678some'
'http://example.org/connections/20180921T1025/1234/1234/4321/5678some'
);
});
});
Expand Down

0 comments on commit ecf6fc1

Please sign in to comment.