Skip to content

Commit b9c57e3

Browse files
committed
allow changing host
1 parent f861454 commit b9c57e3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/kuzzle.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ module.exports = Kuzzle = function (host, options, cb) {
109109
},
110110
host: {
111111
value: host,
112+
writable: true,
112113
enumerable: true
113114
},
114115
wsPort: {
@@ -1003,6 +1004,7 @@ Kuzzle.prototype.disconnect = function () {
10031004

10041005
this.state = 'disconnected';
10051006
this.network.close();
1007+
this.network = null;
10061008

10071009
for (collection in this.collections) {
10081010
if (this.collections.hasOwnProperty(collection)) {

test/kuzzle/methods.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ describe('Kuzzle methods', function () {
399399
kuzzle.collections = { foo: {}, bar: {}, baz: {} };
400400
kuzzle.disconnect();
401401

402-
should(kuzzle.network.close.called).be.true();
402+
should(kuzzle.network).be.null();
403403
should(kuzzle.collections).be.empty();
404404
should(function () { kuzzle.isValid(); }).throw(Error);
405405
});

0 commit comments

Comments
 (0)