Permalink
Browse files

check all data attributes

  • Loading branch information...
1 parent 70b137a commit 076feee809194a7dd226a5970964baa605c63ad5 @swdyh committed Aug 11, 2012
Showing with 4 additions and 8 deletions.
  1. +4 −8 test/test.js
View
12 test/test.js
@@ -11,18 +11,14 @@ function testParseAirpotOutput(t) {
function testParseIwlistOutput(t) {
var d = wifiLocation.parseIwlistOutput(t)
- assert.equal(d.length, 5)
- assert.ok(d[0].Address)
- assert.ok(d[0].ESSID)
- assert.ok(d[0]['Signal level'])
+ assert.ok(d.length > 1)
+ assert.ok(d.every(function(i) { return i.ESSID && i.Address && i['Signal level'] }))
}
function testWifiTowers(t, platform) {
wifiLocation.wifiTowers({ t: t, platform: platform }, function(err, val) {
- assert(val.length > 1)
- assert.ok(val[0].ssid)
- assert.ok(val[0].mac_address)
- assert.ok(val[0].signal_strength)
+ assert.ok(val.length > 1)
+ assert.ok(val.every(function(i) { return i.ssid && i.mac_address && i.signal_strength }))
})
}

0 comments on commit 076feee

Please sign in to comment.