mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-04-30 11:40:04 +03:00
tests: fix isRoughEqual call 🐛, minor change
This commit is contained in:
parent
2ca7e64fd5
commit
4d908e1f72
3 changed files with 7 additions and 7 deletions
|
@ -244,12 +244,11 @@ test('nearby Berlin Jungfernheide', co(function* (t) {
|
||||||
// todo: trim IDs
|
// todo: trim IDs
|
||||||
t.ok(s0.id === '008011167' || s0.id === jungfernheide)
|
t.ok(s0.id === '008011167' || s0.id === jungfernheide)
|
||||||
t.equal(s0.name, 'Berlin Jungfernheide')
|
t.equal(s0.name, 'Berlin Jungfernheide')
|
||||||
t.ok(isRoughlyEqual(s0.location.latitude, 52.530408, .0005))
|
t.ok(isRoughlyEqual(.0005, s0.location.latitude, 52.530408))
|
||||||
t.ok(isRoughlyEqual(s0.location.longitude, 13.299424, .0005))
|
t.ok(isRoughlyEqual(.0005, s0.location.longitude, 13.299424))
|
||||||
t.ok(s0.distance >= 0)
|
t.ok(s0.distance >= 0)
|
||||||
t.ok(s0.distance <= 100)
|
t.ok(s0.distance <= 100)
|
||||||
|
|
||||||
// todo: nearby[0]
|
|
||||||
t.end()
|
t.end()
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
|
@ -269,8 +269,8 @@ test('nearby Salzburg Hbf', co(function* (t) {
|
||||||
const s = nearby[0]
|
const s = nearby[0]
|
||||||
t.ok(s.id === '008100002' || s.id === '8100002', 'id should be 8100002')
|
t.ok(s.id === '008100002' || s.id === '8100002', 'id should be 8100002')
|
||||||
t.equal(s.name, 'Salzburg Hbf')
|
t.equal(s.name, 'Salzburg Hbf')
|
||||||
t.ok(isRoughlyEqual(s.location.latitude, 47.812851, .0005))
|
t.ok(isRoughlyEqual(.0005, s.location.latitude, 47.812851))
|
||||||
t.ok(isRoughlyEqual(s.location.longitude, 13.045604, .0005))
|
t.ok(isRoughlyEqual(.0005, s.location.longitude, 13.045604))
|
||||||
t.ok(s.distance >= 0)
|
t.ok(s.distance >= 0)
|
||||||
t.ok(s.distance <= 100)
|
t.ok(s.distance <= 100)
|
||||||
|
|
||||||
|
|
|
@ -108,8 +108,6 @@ const bismarckstr = '900000024201'
|
||||||
const westhafen = '900000001201'
|
const westhafen = '900000001201'
|
||||||
const wedding = '900000009104'
|
const wedding = '900000009104'
|
||||||
const württembergallee = '900000026153'
|
const württembergallee = '900000026153'
|
||||||
const berlinerStr = '900000044201'
|
|
||||||
const landhausstr = '900000043252'
|
|
||||||
|
|
||||||
test('journeys – Spichernstr. to Bismarckstr.', co(function* (t) {
|
test('journeys – Spichernstr. to Bismarckstr.', co(function* (t) {
|
||||||
const journeys = yield client.journeys(spichernstr, bismarckstr, {
|
const journeys = yield client.journeys(spichernstr, bismarckstr, {
|
||||||
|
@ -301,6 +299,9 @@ test('departures at 7-digit station', co(function* (t) {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
test('nearby', co(function* (t) {
|
test('nearby', co(function* (t) {
|
||||||
|
const berlinerStr = '900000044201'
|
||||||
|
const landhausstr = '900000043252'
|
||||||
|
|
||||||
// Berliner Str./Bundesallee
|
// Berliner Str./Bundesallee
|
||||||
const nearby = yield client.nearby({
|
const nearby = yield client.nearby({
|
||||||
type: 'location',
|
type: 'location',
|
||||||
|
|
Loading…
Add table
Reference in a new issue