forked from sharedstreets/mobility-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generic, crossplatform provider config
- Loading branch information
1 parent
b23ec46
commit ce03e43
Showing
4 changed files
with
77 additions
and
94 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,22 @@ | ||
const test = require("tap").test; | ||
const config = require("../src/config.js"); | ||
const config = require("../config.json"); | ||
|
||
test("config - bird", t => { | ||
config("bird", (err, conf) => { | ||
t.notOk(err, "loaded config without error"); | ||
t.ok(conf, "loaded config"); | ||
t.ok(conf.token, "has token"); | ||
t.ok(conf.trips, "has trips url"); | ||
t.ok(conf.changes, "has changes url"); | ||
test("config", t => { | ||
t.equal(config.boundary.length, 4, "has valid boundary bbox"); | ||
|
||
t.end(); | ||
Object.keys(config.providers).forEach(provider => { | ||
if (config.providers[provider].enabled) { | ||
t.ok( | ||
config.providers[provider].trips.length, | ||
provider + " has trips url" | ||
); | ||
t.ok( | ||
config.providers[provider].status_changes.length, | ||
provider + " has status_changes url" | ||
); | ||
t.ok(config.providers[provider].token.length, provider + " has token"); | ||
} | ||
}); | ||
|
||
t.end(); | ||
}); |