Skip to content

Commit

Permalink
testing ci
Browse files Browse the repository at this point in the history
  • Loading branch information
vaguue committed Jul 13, 2024
1 parent 7f17626 commit 5b4ff49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/liveDevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ class LiveDevice extends Duplex {
try {
this.pcapInternal.open();
} catch(err) {
console.log('err in construct', err);
return callback(err);
}

this.isOpen = true;
if (this.options.filter) {
this.pcapInternal.setFilter(this.options.filter);
Expand Down
6 changes: 4 additions & 2 deletions test/liveDevice.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ test('LiveDevice', (t) => {
if (!ifaceName) return;

try {
const dev = new LiveDevice({ iface: ifaceName });
const dev = new LiveDevice({ iface: 'anpi1' });

dev.on('error', err => {
console.log('caught error', err);
console.log('caught error', err.message);
});

const { iface } = dev;

console.log('iface', iface);

assert.ok(iface.hasOwnProperty('name'));
assert.ok(iface.hasOwnProperty('description'));
assert.ok(iface.hasOwnProperty('mac'));
Expand Down

0 comments on commit 5b4ff49

Please sign in to comment.