-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for channel parsing of airport
- Loading branch information
1 parent
6d0b28b
commit 5ec636b
Showing
6 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,4 @@ function scan(callback) { | |
|
||
exports.scan = scan; | ||
exports.utility = macProvider; | ||
exports.parse = parseAirport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
{ | ||
"name" : "node-wifiscanner", | ||
"version" : "0.2.0", | ||
"description" : "Scan surrounding WiFi access points", | ||
"author": "Maurice Svay <maurice@svay.com>", | ||
"main": "./lib/wifiscanner", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://https://github.com/mauricesvay/node-wifiscanner.git" | ||
} | ||
"name": "node-wifiscanner", | ||
"version": "0.2.0", | ||
"description": "Scan surrounding WiFi access points", | ||
"author": "Maurice Svay <maurice@svay.com>", | ||
"main": "./lib/wifiscanner", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://https://github.com/mauricesvay/node-wifiscanner.git" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
}, | ||
"devDependencies": { | ||
"mocha": "^2.2.5" | ||
}, | ||
"scripts": { | ||
"test": "mocha tests/*.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
var fs = require('fs'); | ||
var assert = require('assert'); | ||
|
||
var airport = require('../lib/airport'); | ||
|
||
describe('Airport', function() { | ||
it('parses channel information', function() { | ||
var aps = airport.parse(fs.readFileSync('./tests/fixtures/airport/basic.txt', { encoding: 'utf8' })); | ||
assert.ok(aps); | ||
assert.equal(aps.length, 1); | ||
assert.deepEqual(aps[0].channel, '1'); | ||
}); | ||
|
||
it('handles APs with multiple channels', function() { | ||
var aps = airport.parse(fs.readFileSync('./tests/fixtures/airport/multi-channel.txt', { encoding: 'utf8' })); | ||
assert.ok(aps); | ||
assert.equal(aps.length, 1); | ||
assert.deepEqual(aps[0].channel, '157,+1'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SSID BSSID RSSI CHANNEL HT CC SECURITY (auth/unicast/group) | ||
testap 40:16:7e:5f:ca:70 0 1 Y -- WPA2(PSK/AES/AES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SSID BSSID RSSI CHANNEL HT CC SECURITY (auth/unicast/group) | ||
testap 40:16:7e:5f:ca:74 -47 157,+1 Y -- WPA2(PSK/AES/AES) |
I think there is a typo at the protocol part.