tests: fix isRoughEqual call 🐛, minor change

This commit is contained in:
Jannis R 2018-05-13 01:03:10 +02:00
parent 2ca7e64fd5
commit 4d908e1f72
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
3 changed files with 7 additions and 7 deletions

View file

@ -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()
})) }))

View file

@ -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)

View file

@ -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',