Skip to content

Commit

Permalink
Merge pull request #399 from conveyal/dev
Browse files Browse the repository at this point in the history
v1.7.0
  • Loading branch information
trevorgerhardt authored Mar 27, 2017
2 parents 8b6b490 + 3b1f423 commit 9f7c8ec
Show file tree
Hide file tree
Showing 75 changed files with 11,193 additions and 2,381 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ node_modules

coverage
deployment
tmp
28 changes: 18 additions & 10 deletions .travis.yml
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+$/
189 changes: 189 additions & 0 deletions __tests__/lib/__snapshots__/r5.js.snap
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",
}
`;
47 changes: 47 additions & 0 deletions __tests__/lib/r5.js
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()
})
})
29 changes: 29 additions & 0 deletions assets/images/graphics/cabi-round.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/graphics/cabi.pnm
Binary file not shown.
4 changes: 2 additions & 2 deletions assets/images/graphics/end.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/images/graphics/start.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion bin/autoenv
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
6 changes: 5 additions & 1 deletion client/browser-store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ function get (name) {
if (localStorageSupported) {
return store(name)
} else {
return JSON.parse(cookie(name))
try {
return JSON.parse(cookie(name))
} catch (e) {
return false
}
}
}
2 changes: 1 addition & 1 deletion client/commute-analysis-page/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var crossfilter = require('crossfilter2')
var dc = require('dc')
var d3 = require('d3')
var L = require('mapbox.js')
var L = require('leaflet')

require('leaflet.markercluster')

Expand Down
2 changes: 1 addition & 1 deletion client/confirm-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Modal.prototype.confirm = function (e) {

/* Modal.prototype.showCancel = function (e) {
return false
}*/
} */

/**
* Expose `confirm`
Expand Down
Loading

0 comments on commit 9f7c8ec

Please sign in to comment.