Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose current Aedes version, used in aedes-stats #294

Merged
merged 4 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aedes.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ Aedes.prototype.close = function (cb = noop) {
}
}

Aedes.prototype.version = require('./package.json').version

function defaultAuthenticate (client, username, password, callback) {
callback(null, true)
}
Expand Down
9 changes: 9 additions & 0 deletions test/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ test('emits client', function (t) {
})
})

test('get aedes version', function (t) {
t.plan(1)

var broker = aedes()
t.equal(broker.version, require('../package.json').version)
broker.close()
t.end()
})

test('connect and connackSent event', function (t) {
var s = setup()
var clientId = 'my-client'
Expand Down