mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
radar(n, w, s, e) -> radar({n, w, s, e}) 💥, adapt tests ✅
This commit is contained in:
parent
f96131423f
commit
40b559f80d
4 changed files with 14 additions and 4 deletions
2
index.js
2
index.js
|
@ -289,7 +289,7 @@ const createClient = (profile, request = _request) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const radar = (north, west, south, east, opt) => {
|
const radar = ({north, west, south, east, opt}) => {
|
||||||
if ('number' !== typeof north) throw new Error('north must be a number.')
|
if ('number' !== typeof north) throw new Error('north must be a number.')
|
||||||
if ('number' !== typeof west) throw new Error('west must be a number.')
|
if ('number' !== typeof west) throw new Error('west must be a number.')
|
||||||
if ('number' !== typeof south) throw new Error('south must be a number.')
|
if ('number' !== typeof south) throw new Error('south must be a number.')
|
||||||
|
|
|
@ -341,7 +341,7 @@ test('radar', co(function* (t) {
|
||||||
const west = 11.600826
|
const west = 11.600826
|
||||||
const south = 52.108486
|
const south = 52.108486
|
||||||
const east = 11.651451
|
const east = 11.651451
|
||||||
const vehicles = yield client.radar(north, west, south, east, {
|
const vehicles = yield client.radar({north, west, south, east}, {
|
||||||
duration: 5 * 60, when, results: 10
|
duration: 5 * 60, when, results: 10
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -450,7 +450,12 @@ test('location', co(function* (t) {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
test('radar Salzburg', co(function* (t) {
|
test('radar Salzburg', co(function* (t) {
|
||||||
const vehicles = yield client.radar(47.827203, 13.001261, 47.773278, 13.07562, {
|
const vehicles = yield client.radar({
|
||||||
|
north: 47.827203,
|
||||||
|
west: 13.001261,
|
||||||
|
south: 47.773278,
|
||||||
|
east: 13.07562
|
||||||
|
}, {
|
||||||
duration: 5 * 60, when
|
duration: 5 * 60, when
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -456,7 +456,12 @@ test('location', co(function* (t) {
|
||||||
|
|
||||||
|
|
||||||
test('radar', co(function* (t) {
|
test('radar', co(function* (t) {
|
||||||
const vehicles = yield client.radar(52.52411, 13.41002, 52.51942, 13.41709, {
|
const vehicles = yield client.radar({
|
||||||
|
north: 52.52411,
|
||||||
|
west: 13.41002,
|
||||||
|
south: 52.51942,
|
||||||
|
east: 13.41709
|
||||||
|
}, {
|
||||||
duration: 5 * 60, when
|
duration: 5 * 60, when
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue