gtfs 3.1.0 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/.eslintrc.json +14 -19
  2. package/.husky/pre-commit +4 -0
  3. package/.prettierrc.js +4 -0
  4. package/CHANGELOG.md +173 -0
  5. package/README.md +115 -126
  6. package/bin/gtfs-export.js +4 -5
  7. package/bin/gtfs-import.js +6 -7
  8. package/config-sample-full.json +2 -7
  9. package/lib/db.js +4 -2
  10. package/lib/export.js +26 -9
  11. package/lib/file-utils.js +26 -9
  12. package/lib/geojson-utils.js +51 -38
  13. package/lib/gtfs/agencies.js +8 -2
  14. package/lib/gtfs/attributions.js +8 -2
  15. package/lib/gtfs/calendar-dates.js +8 -2
  16. package/lib/gtfs/calendars.js +8 -2
  17. package/lib/gtfs/fare-attributes.js +8 -2
  18. package/lib/gtfs/fare-rules.js +8 -2
  19. package/lib/gtfs/feed-info.js +8 -2
  20. package/lib/gtfs/frequencies.js +8 -2
  21. package/lib/gtfs/levels.js +8 -2
  22. package/lib/gtfs/pathways.js +8 -2
  23. package/lib/gtfs/routes.js +15 -4
  24. package/lib/gtfs/shapes.js +49 -18
  25. package/lib/gtfs/stop-times.js +8 -2
  26. package/lib/gtfs/stops.js +45 -16
  27. package/lib/gtfs/transfers.js +8 -2
  28. package/lib/gtfs/translations.js +8 -2
  29. package/lib/gtfs/trips.js +8 -2
  30. package/lib/gtfs-ride/board-alights.js +8 -2
  31. package/lib/gtfs-ride/ride-feed-infos.js +8 -2
  32. package/lib/gtfs-ride/rider-trips.js +8 -2
  33. package/lib/gtfs-ride/riderships.js +8 -2
  34. package/lib/gtfs-ride/trip-capacities.js +8 -2
  35. package/lib/import.js +200 -125
  36. package/lib/log-utils.js +8 -4
  37. package/lib/non-standard/directions.js +8 -2
  38. package/lib/non-standard/stop-attributes.js +8 -2
  39. package/lib/non-standard/timetable-notes-references.js +13 -3
  40. package/lib/non-standard/timetable-notes.js +8 -2
  41. package/lib/non-standard/timetable-pages.js +8 -2
  42. package/lib/non-standard/timetable-stop-order.js +13 -3
  43. package/lib/non-standard/timetables.js +8 -2
  44. package/lib/utils.js +22 -11
  45. package/models/gtfs/agency.js +11 -11
  46. package/models/gtfs/attributions.js +14 -14
  47. package/models/gtfs/calendar-dates.js +7 -7
  48. package/models/gtfs/calendar.js +12 -12
  49. package/models/gtfs/fare-attributes.js +9 -9
  50. package/models/gtfs/fare-rules.js +8 -8
  51. package/models/gtfs/feed-info.js +12 -12
  52. package/models/gtfs/frequencies.js +10 -10
  53. package/models/gtfs/levels.js +5 -5
  54. package/models/gtfs/pathways.js +14 -14
  55. package/models/gtfs/routes.js +14 -14
  56. package/models/gtfs/shapes.js +8 -8
  57. package/models/gtfs/stop-times.js +17 -17
  58. package/models/gtfs/stops.js +17 -17
  59. package/models/gtfs/transfers.js +7 -7
  60. package/models/gtfs/translations.js +10 -10
  61. package/models/gtfs/trips.js +12 -12
  62. package/models/gtfs-ride/board-alight.js +24 -24
  63. package/models/gtfs-ride/ride-feed-info.js +8 -8
  64. package/models/gtfs-ride/rider-trip.js +21 -21
  65. package/models/gtfs-ride/ridership.js +23 -23
  66. package/models/gtfs-ride/trip-capacity.js +10 -10
  67. package/models/models.js +1 -1
  68. package/models/non-standard/directions.js +6 -6
  69. package/models/non-standard/stop-attributes.js +5 -5
  70. package/models/non-standard/timetable-notes-references.js +9 -9
  71. package/models/non-standard/timetable-notes.js +5 -5
  72. package/models/non-standard/timetable-pages.js +5 -5
  73. package/models/non-standard/timetable-stop-order.js +6 -6
  74. package/models/non-standard/timetables.js +27 -27
  75. package/package.json +29 -11
  76. package/test/mocha/export-gtfs.js +63 -40
  77. package/test/mocha/get-agencies.js +11 -11
  78. package/test/mocha/get-attributions.js +1 -1
  79. package/test/mocha/get-board-alights.js +1 -1
  80. package/test/mocha/get-calendar-dates.js +22 -21
  81. package/test/mocha/get-calendars.js +8 -8
  82. package/test/mocha/get-db.js +9 -2
  83. package/test/mocha/get-directions.js +1 -1
  84. package/test/mocha/get-fare-attributes.js +3 -3
  85. package/test/mocha/get-fare-rules.js +8 -10
  86. package/test/mocha/get-feed-info.js +1 -1
  87. package/test/mocha/get-frequencies.js +1 -1
  88. package/test/mocha/get-levels.js +1 -1
  89. package/test/mocha/get-pathways.js +1 -1
  90. package/test/mocha/get-rider-trips.js +1 -1
  91. package/test/mocha/get-riderships.js +1 -1
  92. package/test/mocha/get-routes.js +9 -13
  93. package/test/mocha/get-shapes-as-geojson.js +3 -3
  94. package/test/mocha/get-shapes.js +28 -36
  95. package/test/mocha/get-stop-attributes.js +1 -1
  96. package/test/mocha/get-stops-as-geojson.js +2 -2
  97. package/test/mocha/get-stops.js +59 -48
  98. package/test/mocha/get-stoptimes.js +9 -7
  99. package/test/mocha/get-timetable-pages.js +1 -1
  100. package/test/mocha/get-timetable-stop-orders.js +1 -1
  101. package/test/mocha/get-timetables.js +1 -1
  102. package/test/mocha/get-transfers.js +1 -1
  103. package/test/mocha/get-translations.js +1 -1
  104. package/test/mocha/get-trip-capacities.js +1 -1
  105. package/test/mocha/get-trips.js +3 -3
  106. package/test/mocha/import-gtfs.js +59 -42
  107. package/test/test-config.js +9 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtfs",
3
- "version": "3.1.0",
3
+ "version": "3.1.4",
4
4
  "description": "Import GTFS transit data into SQLite and query routes, stops, times, fares and more",
5
5
  "keywords": [
6
6
  "transit",
@@ -62,36 +62,54 @@
62
62
  },
63
63
  "scripts": {
64
64
  "lint": "eslint **/*.js",
65
+ "lint-fix": "eslint **/*.js --fix",
65
66
  "test": "eslint **/*.js && NODE_ENV=test mocha ./test/mocha/**/*.js --timeout 2000"
66
67
  },
67
68
  "dependencies": {
68
69
  "@turf/helpers": "^6.5.0",
69
70
  "chalk": "^4.1.2",
70
- "copy-dir": "^1.3.0",
71
- "csv-parse": "^4.16.0",
72
- "csv-stringify": "^5.6.2",
71
+ "csv-parse": "^4.16.3",
72
+ "csv-stringify": "^5.6.5",
73
73
  "lodash-es": "^4.17.21",
74
- "node-fetch": "^2.6.1",
74
+ "node-fetch": "^3.0.0",
75
75
  "pluralize": "^8.0.0",
76
76
  "pretty-error": "^3.0.4",
77
77
  "promise-map-series": "^0.3.0",
78
+ "recursive-copy": "^2.0.13",
78
79
  "sanitize-filename": "^1.6.3",
79
80
  "sqlite": "^4.0.23",
80
81
  "sqlite3": "^5.0.2",
81
82
  "sqlstring-sqlite": "^0.1.1",
82
- "strip-bom-stream": "^4.0.0",
83
+ "strip-bom-stream": "^5.0.0",
83
84
  "tmp-promise": "^3.0.2",
84
85
  "untildify": "^4.0.0",
85
86
  "unzipper": "^0.10.11",
86
- "yargs": "^17.0.1"
87
+ "yargs": "^17.2.1"
87
88
  },
88
89
  "devDependencies": {
89
- "mocha": "^9.0.3",
90
- "should": "^13.2.3",
91
- "eslint": "^7.32.0",
92
- "eslint-config-xo": "^0.37.0"
90
+ "eslint": "^8.0.1",
91
+ "eslint-config-prettier": "^8.3.0",
92
+ "eslint-config-xo": "^0.39.0",
93
+ "husky": "^7.0.2",
94
+ "mocha": "^9.1.3",
95
+ "prettier": "^2.4.1",
96
+ "pretty-quick": "^3.1.1",
97
+ "should": "^13.2.3"
93
98
  },
94
99
  "engines": {
95
100
  "node": ">= 14.17.0"
101
+ },
102
+ "release-it": {
103
+ "github": {
104
+ "release": true
105
+ },
106
+ "plugins": {
107
+ "@release-it/keep-a-changelog": {
108
+ "filename": "CHANGELOG.md"
109
+ }
110
+ }
111
+ },
112
+ "prettier": {
113
+ "singleQuote": true
96
114
  }
97
115
  }
@@ -33,52 +33,72 @@ describe('exportGtfs():', function () {
33
33
 
34
34
  describe('Verify data exported', () => {
35
35
  const countData = {};
36
- const temporaryDir = path.join(path.dirname(fileURLToPath(import.meta.url)), '../fixture/tmp/');
36
+ const temporaryDir = path.join(
37
+ path.dirname(fileURLToPath(import.meta.url)),
38
+ '../fixture/tmp/'
39
+ );
37
40
 
38
41
  before(async () => {
39
42
  await unzip(config.agencies[0].path, temporaryDir);
40
43
 
41
- await Promise.all(models.map(model => {
42
- const filePath = path.join(temporaryDir, `${model.filenameBase}.txt`);
44
+ await Promise.all(
45
+ models.map((model) => {
46
+ const filePath = path.join(temporaryDir, `${model.filenameBase}.txt`);
43
47
 
44
- // GTFS has optional files
45
- if (!existsSync(filePath)) {
46
- countData[model.filenameBase] = 0;
47
- return false;
48
- }
49
-
50
- const parser = parse({
51
- columns: true,
52
- relax: true,
53
- trim: true
54
- }, (error, data) => {
55
- if (error) {
56
- throw new Error(error);
48
+ // GTFS has optional files
49
+ if (!existsSync(filePath)) {
50
+ countData[model.filenameBase] = 0;
51
+ return false;
57
52
  }
58
53
 
59
- countData[model.filenameBase] = data.length;
60
- });
61
-
62
- return createReadStream(filePath)
63
- .pipe(parser)
64
- .on('error', error => {
65
- countData[model.collection] = 0;
66
- throw new Error(error);
67
- });
68
- }));
54
+ const parser = parse(
55
+ {
56
+ columns: true,
57
+ relax: true,
58
+ trim: true,
59
+ },
60
+ (error, data) => {
61
+ if (error) {
62
+ throw new Error(error);
63
+ }
64
+
65
+ countData[model.filenameBase] = data.length;
66
+ }
67
+ );
68
+
69
+ return createReadStream(filePath)
70
+ .pipe(parser)
71
+ .on('error', (error) => {
72
+ countData[model.collection] = 0;
73
+ throw new Error(error);
74
+ });
75
+ })
76
+ );
69
77
 
70
78
  await importGtfs(config);
71
79
  });
72
80
 
73
81
  after(async () => {
74
82
  const agencies = await getAgencies({}, ['agency_name']);
75
- await rm(path.join(process.cwd(), 'gtfs-export', generateFolderName(agencies[0].agency_name)), { recursive: true, force: true });
83
+ await rm(
84
+ path.join(
85
+ process.cwd(),
86
+ 'gtfs-export',
87
+ generateFolderName(agencies[0].agency_name)
88
+ ),
89
+ { recursive: true, force: true }
90
+ );
76
91
  });
77
92
 
78
93
  for (const model of models) {
79
94
  it(`should import the same number of ${model.filenameBase}`, async () => {
80
95
  const agencies = await getAgencies({}, ['agency_name']);
81
- const filePath = path.join(process.cwd(), 'gtfs-export', generateFolderName(agencies[0].agency_name), `${model.filenameBase}.txt`);
96
+ const filePath = path.join(
97
+ process.cwd(),
98
+ 'gtfs-export',
99
+ generateFolderName(agencies[0].agency_name),
100
+ `${model.filenameBase}.txt`
101
+ );
82
102
 
83
103
  // GTFS has optional files
84
104
  if (!existsSync(filePath)) {
@@ -87,23 +107,26 @@ describe('exportGtfs():', function () {
87
107
  return;
88
108
  }
89
109
 
90
- const parser = parse({
91
- columns: true,
92
- relax: true,
93
- trim: true
94
- }, (error, data) => {
95
- if (error) {
96
- throw new Error(error);
97
- }
110
+ const parser = parse(
111
+ {
112
+ columns: true,
113
+ relax: true,
114
+ trim: true,
115
+ },
116
+ (error, data) => {
117
+ if (error) {
118
+ throw new Error(error);
119
+ }
98
120
 
99
- should.not.exist(error);
121
+ should.not.exist(error);
100
122
 
101
- data.length.should.equal(countData[model.filenameBase]);
102
- });
123
+ data.length.should.equal(countData[model.filenameBase]);
124
+ }
125
+ );
103
126
 
104
127
  return createReadStream(filePath)
105
128
  .pipe(parser)
106
- .on('error', error => {
129
+ .on('error', (error) => {
107
130
  should.not.exist(error);
108
131
  });
109
132
  });
@@ -18,7 +18,7 @@ describe('getAgencies():', () => {
18
18
  it('should return empty array if no agencies exist', async () => {
19
19
  const agencyId = 'fake-agency-id';
20
20
  const results = await getAgencies({
21
- agency_id: agencyId
21
+ agency_id: agencyId,
22
22
  });
23
23
  should.exists(results);
24
24
  results.should.have.length(0);
@@ -36,7 +36,7 @@ describe('getAgencies():', () => {
36
36
  agency_lang: 'en',
37
37
  agency_phone: '800-660-4287',
38
38
  agency_fare_url: null,
39
- agency_email: null
39
+ agency_email: null,
40
40
  };
41
41
 
42
42
  should.exist(results);
@@ -50,7 +50,7 @@ describe('getAgencies():', () => {
50
50
 
51
51
  const results = await getAgencies({
52
52
  agency_id: agencyId,
53
- agency_lang: agencyLand
53
+ agency_lang: agencyLand,
54
54
  });
55
55
 
56
56
  const expectedResult = {
@@ -62,7 +62,7 @@ describe('getAgencies():', () => {
62
62
  agency_lang: 'en',
63
63
  agency_phone: '800-660-4287',
64
64
  agency_fare_url: null,
65
- agency_email: null
65
+ agency_email: null,
66
66
  };
67
67
 
68
68
  should.exist(results);
@@ -73,16 +73,16 @@ describe('getAgencies():', () => {
73
73
  it('should return only specific keys for expected agency for agency_id', async () => {
74
74
  const agencyId = 'CT';
75
75
 
76
- const results = await getAgencies({
77
- agency_id: agencyId
78
- }, [
79
- 'agency_url',
80
- 'agency_lang'
81
- ]);
76
+ const results = await getAgencies(
77
+ {
78
+ agency_id: agencyId,
79
+ },
80
+ ['agency_url', 'agency_lang']
81
+ );
82
82
 
83
83
  const expectedResult = {
84
84
  agency_url: 'http://www.caltrain.com',
85
- agency_lang: 'en'
85
+ agency_lang: 'en',
86
86
  };
87
87
 
88
88
  should.exist(results);
@@ -19,7 +19,7 @@ describe('getAttributions():', () => {
19
19
  it('should return empty array if no attributions exist', async () => {
20
20
  const attributionId = 'fake-attribution-id';
21
21
  const results = await getAttributions({
22
- attribution_id: attributionId
22
+ attribution_id: attributionId,
23
23
  });
24
24
  should.exists(results);
25
25
  results.should.have.length(0);
@@ -20,7 +20,7 @@ describe('getBoardAlights():', () => {
20
20
  const tripId = 'fake-trip-id';
21
21
 
22
22
  const results = await getBoardAlights({
23
- trip_id: tripId
23
+ trip_id: tripId,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);
@@ -20,7 +20,7 @@ describe('getCalendarDates():', () => {
20
20
  const serviceId = 'fake-service-id';
21
21
 
22
22
  const results = await getCalendarDates({
23
- service_id: serviceId
23
+ service_id: serviceId,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);
@@ -30,7 +30,7 @@ describe('getCalendarDates():', () => {
30
30
  const serviceId = 'CT-16APR-Caltrain-Weekday-01';
31
31
 
32
32
  const results = await getCalendarDates({
33
- service_id: serviceId
33
+ service_id: serviceId,
34
34
  });
35
35
 
36
36
  should.exists(results);
@@ -42,29 +42,29 @@ describe('getCalendarDates():', () => {
42
42
  service_id: 'CT-16APR-Caltrain-Weekday-01',
43
43
  date: 20161124,
44
44
  exception_type: 2,
45
- holiday_name: null
45
+ holiday_name: null,
46
46
  },
47
47
  {
48
48
  id: 4,
49
49
  service_id: 'CT-16APR-Caltrain-Weekday-01',
50
50
  date: 20160905,
51
51
  exception_type: 2,
52
- holiday_name: null
52
+ holiday_name: null,
53
53
  },
54
54
  {
55
55
  id: 6,
56
56
  service_id: 'CT-16APR-Caltrain-Weekday-01',
57
57
  date: 20160704,
58
58
  exception_type: 2,
59
- holiday_name: null
59
+ holiday_name: null,
60
60
  },
61
61
  {
62
62
  id: 8,
63
63
  service_id: 'CT-16APR-Caltrain-Weekday-01',
64
64
  date: 20160530,
65
65
  exception_type: 2,
66
- holiday_name: null
67
- }
66
+ holiday_name: null,
67
+ },
68
68
  ];
69
69
 
70
70
  for (const result of results) {
@@ -75,33 +75,34 @@ describe('getCalendarDates():', () => {
75
75
  it('should return only specific keys for expected calendar dates, sorted by date', async () => {
76
76
  const serviceId = 'CT-16APR-Caltrain-Weekday-01';
77
77
 
78
- const results = await getCalendarDates({
79
- service_id: serviceId
80
- }, [
81
- 'service_id',
82
- 'date'
83
- ], [
84
- ['date', 'ASC'],
85
- ['service_id', 'ASC']
86
- ]);
78
+ const results = await getCalendarDates(
79
+ {
80
+ service_id: serviceId,
81
+ },
82
+ ['service_id', 'date'],
83
+ [
84
+ ['date', 'ASC'],
85
+ ['service_id', 'ASC'],
86
+ ]
87
+ );
87
88
 
88
89
  const expectedResults = [
89
90
  {
90
91
  service_id: 'CT-16APR-Caltrain-Weekday-01',
91
- date: 20160530
92
+ date: 20160530,
92
93
  },
93
94
  {
94
95
  service_id: 'CT-16APR-Caltrain-Weekday-01',
95
- date: 20160704
96
+ date: 20160704,
96
97
  },
97
98
  {
98
99
  service_id: 'CT-16APR-Caltrain-Weekday-01',
99
- date: 20160905
100
+ date: 20160905,
100
101
  },
101
102
  {
102
103
  service_id: 'CT-16APR-Caltrain-Weekday-01',
103
- date: 20161124
104
- }
104
+ date: 20161124,
105
+ },
105
106
  ];
106
107
 
107
108
  results.length.should.equal(4);
@@ -20,7 +20,7 @@ describe('getCalendars():', () => {
20
20
  const serviceId = 'fake-service-id';
21
21
 
22
22
  const results = await getCalendars({
23
- service_id: serviceId
23
+ service_id: serviceId,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);
@@ -28,7 +28,7 @@ describe('getCalendars():', () => {
28
28
 
29
29
  it('should return expected calendars by day', async () => {
30
30
  const results = await getCalendars({
31
- sunday: 1
31
+ sunday: 1,
32
32
  });
33
33
 
34
34
  const expectedResult = {
@@ -41,7 +41,7 @@ describe('getCalendars():', () => {
41
41
  saturday: 0,
42
42
  sunday: 1,
43
43
  start_date: 20140323,
44
- end_date: 20190331
44
+ end_date: 20190331,
45
45
  };
46
46
 
47
47
  should.exist(results);
@@ -53,8 +53,8 @@ describe('getCalendars():', () => {
53
53
  const results = await getCalendars({
54
54
  service_id: [
55
55
  'CT-16APR-Caltrain-Saturday-02',
56
- 'CT-16APR-Caltrain-Sunday-02'
57
- ]
56
+ 'CT-16APR-Caltrain-Sunday-02',
57
+ ],
58
58
  });
59
59
 
60
60
  const expectedResults = [
@@ -68,7 +68,7 @@ describe('getCalendars():', () => {
68
68
  saturday: 1,
69
69
  sunday: 0,
70
70
  start_date: 20140329,
71
- end_date: 20190331
71
+ end_date: 20190331,
72
72
  },
73
73
  {
74
74
  service_id: 'CT-16APR-Caltrain-Sunday-02',
@@ -80,8 +80,8 @@ describe('getCalendars():', () => {
80
80
  saturday: 0,
81
81
  sunday: 1,
82
82
  start_date: 20140323,
83
- end_date: 20190331
84
- }
83
+ end_date: 20190331,
84
+ },
85
85
  ];
86
86
 
87
87
  should.exist(results);
@@ -19,7 +19,11 @@ describe('getDb():', () => {
19
19
  it('should allow raw db queries: calendar_dates', async () => {
20
20
  const serviceIds = ['CT-16APR-Caltrain-Weekday-01'];
21
21
  const db = getDb();
22
- const results = await db.all(`SELECT * FROM calendar_dates WHERE exception_type = 1 AND service_id NOT IN (${serviceIds.map(serviceId => `'${serviceId}'`).join(', ')})`);
22
+ const results = await db.all(
23
+ `SELECT * FROM calendar_dates WHERE exception_type = 1 AND service_id NOT IN (${serviceIds
24
+ .map((serviceId) => `'${serviceId}'`)
25
+ .join(', ')})`
26
+ );
23
27
 
24
28
  should.exists(results);
25
29
  results.should.have.length(4);
@@ -30,7 +34,10 @@ describe('getDb():', () => {
30
34
  const startStopId = '70261';
31
35
  const endStopId = '70131';
32
36
  const db = getDb();
33
- const results = await db.all('SELECT * from trips where trips.trip_id IN (SELECT start_stop_times.trip_id FROM stop_times as start_stop_times WHERE stop_id = ? AND start_stop_times.stop_sequence < (SELECT end_stop_times.stop_sequence FROM stop_times as end_stop_times WHERE end_stop_times.stop_sequence > start_stop_times.stop_sequence AND end_stop_times.trip_id = start_stop_times.trip_id AND end_stop_times.stop_id = ? ))', [startStopId, endStopId]);
37
+ const results = await db.all(
38
+ 'SELECT * from trips where trips.trip_id IN (SELECT start_stop_times.trip_id FROM stop_times as start_stop_times WHERE stop_id = ? AND start_stop_times.stop_sequence < (SELECT end_stop_times.stop_sequence FROM stop_times as end_stop_times WHERE end_stop_times.stop_sequence > start_stop_times.stop_sequence AND end_stop_times.trip_id = start_stop_times.trip_id AND end_stop_times.stop_id = ? ))',
39
+ [startStopId, endStopId]
40
+ );
34
41
  should.exists(results);
35
42
  results.should.have.length(62);
36
43
  });
@@ -20,7 +20,7 @@ describe('getDirections():', () => {
20
20
  const fareRouteId = 'not_real';
21
21
 
22
22
  const results = await getDirections({
23
- route_id: fareRouteId
23
+ route_id: fareRouteId,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);
@@ -20,7 +20,7 @@ describe('getFareAttributes():', () => {
20
20
  const fareId = 'not_real';
21
21
 
22
22
  const results = await getFareAttributes({
23
- fare_id: fareId
23
+ fare_id: fareId,
24
24
  });
25
25
 
26
26
  should.exists(results);
@@ -31,7 +31,7 @@ describe('getFareAttributes():', () => {
31
31
  const fareId = 'OW_1_20160228';
32
32
 
33
33
  const results = await getFareAttributes({
34
- fare_id: fareId
34
+ fare_id: fareId,
35
35
  });
36
36
 
37
37
  const expectedResult = {
@@ -41,7 +41,7 @@ describe('getFareAttributes():', () => {
41
41
  payment_method: 1,
42
42
  transfers: 0,
43
43
  agency_id: null,
44
- transfer_duration: null
44
+ transfer_duration: null,
45
45
  };
46
46
 
47
47
  should.exist(results);
@@ -20,7 +20,7 @@ describe('getFareRules():', () => {
20
20
  const routeId = 'not_real';
21
21
 
22
22
  const results = await getFareRules({
23
- route_id: routeId
23
+ route_id: routeId,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);
@@ -29,20 +29,18 @@ describe('getFareRules():', () => {
29
29
  it('should return expected fare_rules', async () => {
30
30
  const routeId = 'Bu-16APR';
31
31
 
32
- const results = await getFareRules({
33
- route_id: routeId
34
- }, [
35
- 'fare_id',
36
- 'route_id',
37
- 'origin_id',
38
- 'destination_id'
39
- ]);
32
+ const results = await getFareRules(
33
+ {
34
+ route_id: routeId,
35
+ },
36
+ ['fare_id', 'route_id', 'origin_id', 'destination_id']
37
+ );
40
38
 
41
39
  const expectedResult = {
42
40
  fare_id: 'OW_2_20160228',
43
41
  route_id: 'Bu-16APR',
44
42
  origin_id: '6',
45
- destination_id: '5'
43
+ destination_id: '5',
46
44
  };
47
45
 
48
46
  should.exist(results);
@@ -20,7 +20,7 @@ describe('getFeedInfo():', () => {
20
20
  const feedPublisherName = 'not_real';
21
21
 
22
22
  const results = await getFeedInfo({
23
- feed_publisher_name: feedPublisherName
23
+ feed_publisher_name: feedPublisherName,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);
@@ -20,7 +20,7 @@ describe('getFrequencies():', () => {
20
20
  const tripId = 'not_real';
21
21
 
22
22
  const results = await getFrequencies({
23
- trip_id: tripId
23
+ trip_id: tripId,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);
@@ -20,7 +20,7 @@ describe('getLevels():', () => {
20
20
  const levelId = 'not_real';
21
21
 
22
22
  const results = await getLevels({
23
- level_id: levelId
23
+ level_id: levelId,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);
@@ -20,7 +20,7 @@ describe('getPathways():', () => {
20
20
  const pathwayId = 'not_real';
21
21
 
22
22
  const results = await getPathways({
23
- pathway_id: pathwayId
23
+ pathway_id: pathwayId,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);
@@ -20,7 +20,7 @@ describe('getRiderTrips():', () => {
20
20
  const tripId = 'fake-trip-id';
21
21
 
22
22
  const results = await getRiderTrips({
23
- trip_id: tripId
23
+ trip_id: tripId,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);
@@ -20,7 +20,7 @@ describe('getRiderships():', () => {
20
20
  const routeId = 'fake-route-id';
21
21
 
22
22
  const results = await getRiderships({
23
- route_id: routeId
23
+ route_id: routeId,
24
24
  });
25
25
  should.exists(results);
26
26
  results.should.have.length(0);