-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
executable file
·30 lines (25 loc) · 745 Bytes
/
test.js
File metadata and controls
executable file
·30 lines (25 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env node
'use strict'
const test = require('tape')
const stations = require('vbb-stations')
const places = require('./index')
test('stations', (t) => {
for (let name in places.stations) {
const id = places.stations[name]
t.equal(typeof id, 'string', `${name}: Value should be a valid id.`)
const station = stations(id)[0]
t.ok(station, `${id}: station should exist.`)
if (!station) continue
t.equal(station.id, id, `${id}: station.id should exist.`)
}
t.end()
})
test('addresses', (t) => {
for (let key in places.addresses) {
const address = places.addresses[key]
t.equal(typeof address.name, 'string')
t.equal(typeof address.latitude, 'number')
t.equal(typeof address.longitude, 'number')
}
t.end()
})