-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Léo Frachet
committed
Mar 9, 2018
1 parent
9b3f445
commit b1cfbd4
Showing
17 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
|
||
/* Run the tests with mocha: mocha tests.js */ | ||
|
||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
const { expect } = require('chai'); | ||
|
||
const { Gtfs } = require('../index'); | ||
|
||
describe('Tests on GTFS constructor options', () => { | ||
it('Test on forcedSchema', (done) => { | ||
const forcedSchema = Gtfs.getDefaultSchema(); | ||
forcedSchema.deepnessByTableName.modes = 1; | ||
forcedSchema.indexKeysByTableName.modes = { indexKey: 'mode_id' }; | ||
forcedSchema.keysByTableName.modes = [ | ||
'mode_id', | ||
'mode_name', | ||
'mode_url', | ||
'mode_timezone', | ||
'mode_lang', | ||
'mode_phone', | ||
'mode_fare_url', | ||
'mode_email', | ||
]; | ||
forcedSchema.tableNames.push('modes'); | ||
|
||
const path = `${__dirname}/samples/1/`; | ||
const gtfs = new Gtfs(path, { forcedSchema }); | ||
|
||
const mode = gtfs.getItemWithIndexInTable('mode_0', 'modes'); | ||
|
||
expect(mode.mode_name).to.equal('mode 0'); | ||
|
||
done(); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mode_id,mode_name,mode_url,mode_timezone,mode_lang,mode_phone,mode_fare_url,mode_email | ||
mode_0,mode 0,http://google.com,America/New_York,en,(310) 555-0222,http://google.com,contact@google.com |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters