Skip to content

Commit f9fb04e

Browse files
committed
Merge pull request #21 from kuzzleio/unitTests
release v1.0 version
2 parents 8f25db9 + 308b253 commit f9fb04e

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kuzzle-sdk",
3-
"version": "1.0.0-alpha.7",
3+
"version": "1.0.0",
44
"description": "Official Javascript SDK for Kuzzle",
55
"author": "The Kuzzle Team <[email protected]>",
66
"repository": {

src/kuzzleDataCollection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ KuzzleDataCollection.prototype.publish = function (document, options) {
386386
};
387387

388388
/**
389-
* Update a new mapping to the data collection.
389+
* Applies a new mapping to the data collection.
390390
* Note that you cannot delete an existing mapping, you can only add or update one.
391391
*
392392
* @param {object} mapping - mapping to apply

test/kuzzleDataCollection/methods.test.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,43 @@ var
66
KuzzleDataCollection = rewire('../../src/kuzzleDataCollection');
77

88
describe('KuzzleDataCollection methods', function () {
9+
var
10+
expectedQuery,
11+
passedOptions,
12+
error,
13+
result,
14+
collection,
15+
queryStub = function (c, controller, action, query, options, cb) {
16+
emitted = true;
17+
should(c).be.exactly(collection);
18+
should(controller).be.exactly(expectedQuery.controller);
19+
should(action).be.exactly(expectedQuery.action);
920

21+
if (passedOptions) {
22+
should(options).match(passedOptions);
23+
}
24+
25+
if (expectedQuery.body) {
26+
should(query.body).match(expectedQuery.body);
27+
} else {
28+
should(Object.keys(query).length).be.exactly(0);
29+
}
30+
31+
cb(error, result);
32+
},
33+
emitted,
34+
kuzzle;
35+
36+
describe('#advancedSearch', function () {
37+
beforeEach(function () {
38+
kuzzle = new Kuzzle('foo');
39+
kuzzle.query = queryStub;
40+
expectedQuery = {
41+
action: 'search',
42+
controller: 'read'
43+
};
44+
});
45+
46+
//it('')
47+
});
1048
});

0 commit comments

Comments
 (0)