-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #399 from conveyal/dev
v1.7.0
- Loading branch information
Showing
75 changed files
with
11,193 additions
and
2,381 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ node_modules | |
|
||
coverage | ||
deployment | ||
tmp |
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,12 +1,20 @@ | ||
sudo: false | ||
language: node_js | ||
cache: | ||
yarn: true | ||
notifications: | ||
email: false | ||
node_js: | ||
- "6" | ||
services: | ||
- mongodb | ||
env: | ||
matrix: | ||
- NODE_ENV=test | ||
stormpath: | ||
- secure: OvNhiYoMSuF64jPlUYH0UVGh9WtWp+g8/6vkqyeKFPa4W6qpbf5lkd0GTYlA3cYPFtHuaBro9ex2Hw612T3IoUHoQyNZKPNxnlWk4Ao1fmhBe+ljmaSoQJZieiHMmpOXmdi4JEHYi118TwFZ2nyFMwQjTwpg2GA0AnzdCcbl9Vw= | ||
- secure: p273gMdviwrwEcz9nvEdKWM6mZXXCccWuLET8V6BfkIvlm3Yxc8I4w7p76WtowGl0Vo6nW3sU/uYLcL2q0VUf1OGDQ1aS63J0atq2xuBErfCc+jyMHo54JusaNKmIRXtbveM0Co5rZke9gN4tsvpIshQ6xMfGCqYNwaw3YCaS6Q= | ||
- secure: NLnIA3C8vcmK9+4zveYSObLFRbHIJWPuHGLygLJpgJzcJna0cvJSIlY+POvlNjzNzqs7rVAloCRKxgerh0m1x6Wh9MKG3LzVkDj2p6f3CcQDCRRuQMUkUp8433VEXcjLkoFiPQ1CxbLazKq967llgAhDxJeN0SjcPyKivNR5rnM= | ||
- '6' | ||
before_script: | ||
- yarn global add codecov | ||
script: | ||
- yarn run lint | ||
- yarn run cover | ||
- codecov | ||
- yarn run build -- -c configurations/example | ||
after_success: | ||
- npm run semantic-release | ||
branches: | ||
except: | ||
- /^v\d+\.\d+\.\d+$/ |
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,189 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`r5 should request plan 1`] = ` | ||
"query requestPlan($fromLat: Float!, $fromLon: Float!, $toLat: Float!, $toLon: Float!, $fromTime: ZonedDateTime!, $toTime: ZonedDateTime!, $bikeSpeed:Float!, $walkSpeed:Float!) { | ||
plan(minBikeTime: 1, bikeTrafficStress: undefined, fromLat: $fromLat, fromLon: $fromLon, toLat: $toLat, toLon: $toLon, fromTime: $fromTime, toTime: $toTime, directModes: [CAR,WALK,BICYCLE,BICYCLE_RENT], accessModes: [WALK,BICYCLE,BICYCLE_RENT,CAR_PARK], egressModes: [WALK], transitModes: [RAIL,SUBWAY,TRAM], bikeSpeed: $bikeSpeed, walkSpeed: $walkSpeed) { | ||
patterns { | ||
tripPatternIdx | ||
routeId | ||
routeIdx | ||
directionId | ||
stops { | ||
stopId | ||
name | ||
lat | ||
lon | ||
} | ||
trips { | ||
tripId | ||
serviceId | ||
bikesAllowed | ||
} | ||
} | ||
options { | ||
summary | ||
itinerary { | ||
waitingTime | ||
walkTime | ||
distance | ||
transfers | ||
duration | ||
transitTime | ||
startTime | ||
endTime | ||
connection { | ||
access | ||
egress | ||
transit { | ||
pattern | ||
time | ||
} | ||
} | ||
} | ||
transit { | ||
from { | ||
name | ||
stopId | ||
lon | ||
lat | ||
} | ||
to { | ||
name | ||
stopId | ||
lon | ||
lat | ||
} | ||
mode | ||
routes { | ||
id | ||
description | ||
routeIdx | ||
shortName | ||
mode | ||
routeColor | ||
textColor | ||
url | ||
agencyName | ||
} | ||
segmentPatterns { | ||
patternId | ||
patternIdx | ||
routeIdx | ||
fromIndex | ||
toIndex | ||
nTrips | ||
fromArrivalTime | ||
fromDepartureTime | ||
toArrivalTime | ||
toDepartureTime | ||
tripId | ||
} | ||
middle { | ||
mode | ||
duration | ||
distance | ||
geometryPolyline | ||
} | ||
rideStats { | ||
min | ||
avg | ||
max | ||
num | ||
} | ||
waitStats { | ||
min | ||
avg | ||
max | ||
num | ||
} | ||
} | ||
access { | ||
mode | ||
duration | ||
distance | ||
streetEdges { | ||
edgeId | ||
geometryPolyline | ||
distance | ||
mode | ||
streetName | ||
relativeDirection | ||
absoluteDirection | ||
stayOn | ||
area | ||
exit | ||
bogusName | ||
bikeRentalOnStation { | ||
id | ||
name | ||
lat | ||
lon | ||
} | ||
bikeRentalOffStation { | ||
id | ||
name | ||
lat | ||
lon | ||
} | ||
parkRide { | ||
id | ||
name | ||
capacity | ||
lon | ||
lat | ||
} | ||
} | ||
} | ||
egress { | ||
mode | ||
duration | ||
distance | ||
streetEdges { | ||
edgeId | ||
distance | ||
geometryPolyline | ||
mode | ||
streetName | ||
relativeDirection | ||
absoluteDirection | ||
stayOn | ||
area | ||
exit | ||
bogusName | ||
bikeRentalOnStation { | ||
id | ||
name | ||
lon | ||
lat | ||
} | ||
} | ||
} | ||
fares { | ||
type | ||
low | ||
peak | ||
senior | ||
transferReduction | ||
currency | ||
} | ||
} | ||
} | ||
}" | ||
`; | ||
|
||
exports[`r5 should request plan 2`] = ` | ||
Object { | ||
"fromLat": 38.943037, | ||
"fromLon": -77.029199, | ||
"fromTime": "2016-06-17T11:00:00.000Z", | ||
"toLat": 38.891254, | ||
"toLon": -77.085016, | ||
"toTime": "2016-06-17T13:00:00.000Z", | ||
} | ||
`; | ||
|
||
exports[`r5 should request plan 3`] = ` | ||
Object { | ||
"fake": "response", | ||
} | ||
`; |
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,47 @@ | ||
/* globals describe, expect, it */ | ||
|
||
process.env.TEST_R5_URL = 'http://mock-host.com' | ||
|
||
import nock from 'nock' | ||
|
||
const r5 = require('../../lib/r5') | ||
|
||
describe('r5', () => { | ||
it('should request plan', async () => { | ||
nock('http://mock-host.com') | ||
.post('/') | ||
.reply(200, (uri, requestBody) => { | ||
expect(uri).toBe('/') | ||
expect(requestBody.query).toMatchSnapshot() | ||
expect(JSON.parse(requestBody.variables)).toMatchSnapshot() | ||
return { | ||
data: { | ||
plan: { | ||
fake: 'response' | ||
} | ||
} | ||
} | ||
}) | ||
|
||
const response = await r5.requestPlan({ | ||
from: { | ||
lon: -77.029199, | ||
lat: 38.943037 | ||
}, | ||
to: { | ||
lon: -77.085016, | ||
lat: 38.891254 | ||
}, | ||
date: '2016-06-17', | ||
fromTime: '7:00', | ||
toTime: '9:00', | ||
accessModes: 'WALK,BICYCLE,BICYCLE_RENT,CAR_PARK', | ||
directModes: 'CAR,WALK,BICYCLE,BICYCLE_RENT', | ||
egressModes: 'WALK', | ||
transitModes: 'TRAINISH' | ||
}) | ||
|
||
delete response.responseTime | ||
expect(response).toMatchSnapshot() | ||
}) | ||
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,4 +1,4 @@ | ||
#!/bin/sh | ||
|
||
export MODEIFY_CONFIG="$(yaml2json ./configurations/default/settings.yml | base64)" | ||
export MODEIFY_CONFIG="$(./node_modules/.bin/yaml2json ./configurations/default/settings.yml | base64)" | ||
source ./configurations/default/env |
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
Oops, something went wrong.