Skip to content

Commit

Permalink
Fix for discover method test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jas- committed Oct 17, 2015
1 parent 2ffed2f commit 80cb81e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions test/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,26 @@
*/

var nmap = require('../')
, os = require('os')
, timeout = 1024 * 1024
, chai = require('chai')
, should = chai.should()
, expect = chai.expect;
, expect = chai.expect
, ifaces = require('os').networkInterfaces();

describe('nmap', function() {
describe('discovery method', function() {
it('validate report', function(done) {
nmap.discover(function(err, report) {
if (!os.networkInterfaces().eth0[0].hasOwnProperty('subnet')) {
should.exist(err);
should.not.exist(report);
} else {
should.not.exist(err);
should.exist(report);
for (var adapter in ifaces) {
if (!ifaces[adapter][0].internal) {
if (!ifaces[adapter][0].hasOwnProperty('subnet')) {
should.exist(err);
should.not.exist(report);
} else {
should.not.exist(err);
should.exist(report);
}
}
}
done();
});
Expand Down

0 comments on commit 80cb81e

Please sign in to comment.