Comparing version 0.5.1 to 0.5.2
@@ -1,2 +0,1 @@ | ||
var debug = require('debug')('mdns:browser'); | ||
@@ -140,7 +139,10 @@ | ||
var onMessageListener = internal.onMessage.bind(this); | ||
this.stop = function () { | ||
networking.removeUsage(this); | ||
networking.removeListener('packets', onMessageListener); | ||
};//--start | ||
networking.on('packets', internal.onMessage.bind(this)); | ||
networking.on('packets', onMessageListener); | ||
@@ -147,0 +149,0 @@ this.discover = function () { |
@@ -68,2 +68,4 @@ var debug = require('debug')('mdns:lib:networking'); | ||
this.connections = []; | ||
this.created = 0; | ||
this.started = false; | ||
@@ -70,0 +72,0 @@ function closeEach(connection) { |
{ | ||
"name": "mdns-js", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"repository": { | ||
@@ -24,8 +24,9 @@ "type": "git", | ||
"devDependencies": { | ||
"code": "*", | ||
"code": "^4.0.0", | ||
"eslint": "^3.12.2", | ||
"joi": "~7.1.0", | ||
"lab": "*" | ||
"lab": "^11.2.1" | ||
}, | ||
"scripts": { | ||
"test": "lab --flat --coverage", | ||
"test": "lab --flat && npm run lint", | ||
"lint": "eslint test examples lib index.js", | ||
@@ -46,2 +47,2 @@ "doc": "jsdoc -d .\\doc index.js lib" | ||
"homepage": "https://github.com/mdns-js/node-mdns-js" | ||
} | ||
} |
@@ -34,11 +34,11 @@ var Lab = require('lab'); | ||
function (done) { | ||
browser.once('update', function onUpdate(data) { | ||
expect(data).to.include(['interfaceIndex', 'networkInterface', | ||
'addresses', 'query']); | ||
done(); | ||
browser.once('update', function onUpdate(data) { | ||
expect(data).to.include(['interfaceIndex', 'networkInterface', | ||
'addresses', 'query']); | ||
done(); | ||
}); | ||
setTimeout(browser.discover.bind(browser), 500); | ||
}); | ||
setTimeout(browser.discover.bind(browser), 500); | ||
}); | ||
}); |
@@ -16,3 +16,3 @@ var Lab = require('lab'); | ||
var type = new ServiceType('_http._tcp'); | ||
expect(type).to.include({protocol: 'tcp', name: 'http'}); | ||
expect(type).to.include({ protocol: 'tcp', name: 'http' }); | ||
expect(type.subtypes).to.be.empty(); | ||
@@ -27,3 +27,3 @@ expect(type.isWildcard()).to.be.false(); | ||
var type = new ServiceType('service._http._tcp'); | ||
expect(type).to.include({protocol: 'tcp', name: 'http'}); | ||
expect(type).to.include({ protocol: 'tcp', name: 'http' }); | ||
expect(type.subtypes).to.be.empty(); | ||
@@ -35,3 +35,3 @@ done(); | ||
var type = new ServiceType('service._http._tcp.local'); | ||
expect(type).to.include({protocol: 'tcp', name: 'http'}); | ||
expect(type).to.include({ protocol: 'tcp', name: 'http' }); | ||
expect(type.subtypes).to.be.empty(); | ||
@@ -43,3 +43,3 @@ done(); | ||
var type = new ServiceType('_services._dns-sd._udp'); | ||
expect(type).to.include({protocol: 'udp', name: 'services._dns-sd'}); | ||
expect(type).to.include({ protocol: 'udp', name: 'services._dns-sd' }); | ||
expect(type.subtypes).to.be.empty(); | ||
@@ -51,3 +51,3 @@ done(); | ||
var type = new ServiceType(['_http', '_tcp']); | ||
expect(type).to.include({protocol: 'tcp', name: 'http'}); | ||
expect(type).to.include({ protocol: 'tcp', name: 'http' }); | ||
expect(type.subtypes).to.be.empty(); | ||
@@ -59,3 +59,3 @@ done(); | ||
var type = new ServiceType('_http', '_tcp'); | ||
expect(type).to.include({protocol: 'tcp', name: 'http'}); | ||
expect(type).to.include({ protocol: 'tcp', name: 'http' }); | ||
expect(type.subtypes).to.be.empty(); | ||
@@ -67,3 +67,3 @@ done(); | ||
var type = new ServiceType(); | ||
expect(type).to.include({protocol: '', name: ''}); | ||
expect(type).to.include({ protocol: '', name: '' }); | ||
expect(type.subtypes).to.be.empty(); | ||
@@ -74,4 +74,4 @@ done(); | ||
it('should take object as argument', function (done) { | ||
var type = new ServiceType({protocol: 'tcp', name: 'http'}); | ||
expect(type).to.include({protocol: 'tcp', name: 'http'}); | ||
var type = new ServiceType({ protocol: 'tcp', name: 'http' }); | ||
expect(type).to.include({ protocol: 'tcp', name: 'http' }); | ||
expect(type.subtypes).to.be.empty(); | ||
@@ -85,6 +85,6 @@ done(); | ||
name: 'http', | ||
subtypes:['printer'] | ||
subtypes: ['printer'] | ||
}); | ||
expect(type).to.include({protocol: 'tcp', name: 'http'}); | ||
expect(type.subtypes).to.deep.equal(['printer']); | ||
expect(type).to.include({ protocol: 'tcp', name: 'http' }); | ||
expect(type.subtypes).to.equal(['printer']); | ||
done(); | ||
@@ -114,3 +114,3 @@ }); | ||
var type = new ServiceType(['_http']); | ||
expect(type).to.include({protocol: 'tcp', name: 'http'}); | ||
expect(type).to.include({ protocol: 'tcp', name: 'http' }); | ||
expect(type.subtypes).to.be.empty(); | ||
@@ -141,3 +141,3 @@ done(); | ||
function fn() { | ||
new ServiceType({protocol:'tcp'}); | ||
new ServiceType({ protocol: 'tcp' }); | ||
} | ||
@@ -151,3 +151,3 @@ expect(fn).to.throw(Error, | ||
function fn() { | ||
new ServiceType({name: 'http'}); | ||
new ServiceType({ name: 'http' }); | ||
} | ||
@@ -154,0 +154,0 @@ expect(fn).to.throw(Error, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80616
1803
4