Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
7 changes: 2 additions & 5 deletions features/steps/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ Then(/^the collection(?: '(.*?)')? should exist$/, async function (collection) {
Then('the mapping of {string} should be updated', async function (collection) {
const mapping = await this.kuzzle.collection.getMapping(this.index, collection);

should(mapping[this.index].mappings[collection]).eql({
properties: {
gordon: {type: 'keyword'}
}
should(mapping[this.index].mappings[collection].properties).eql({
gordon: { type: 'keyword' }
});
});

Expand All @@ -129,7 +127,6 @@ Then('the specifications of {string} must not exist', async function (collection
catch (error) {
should(error.status).eql(404);
}

});

Then('they should be validated', function () {
Expand Down
4 changes: 4 additions & 0 deletions src/Kuzzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ class Kuzzle extends KuzzleEventEmitter {
return this.protocol.sslConnection;
}

get connected () {
return this.protocol.connected;
}

/**
* Emit an event to all registered listeners
* An event cannot be emitted multiple times before a timeout has been reached.
Expand Down
4 changes: 4 additions & 0 deletions src/protocols/abstract/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class AbstractWrapper extends KuzzleEventEmitter {
return _ssl;
}

get connected () {
return this.state === 'online';
}

/**
* @abstract
* @returns {Promise<any>}
Expand Down
5 changes: 4 additions & 1 deletion src/protocols/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const


class HttpWrapper extends KuzzleAbstractProtocol {

constructor(host, options = {}) {
super(host, options);

Expand All @@ -32,6 +31,10 @@ class HttpWrapper extends KuzzleAbstractProtocol {
return this.ssl ? 'https' : 'http';
}

get connected () {
return true;
}

/**
* Connect to the websocket server
*/
Expand Down