Closed nodkz closed 7 years ago
Update mocha till 3.2.0 in https://github.com/jbdemonte/mongoose-elasticsearch-xp/pull/12/commits/d80f51ac5768c5784d2fee0ca6d60949bcfc2b4f Now it handle Promise, when test returns it.
BEFORE:
it('should handle a lucene query', function(done) {
var self = this;
self.model
.esCount('name:jane')
.then(function(result) {
expect(result.count).to.eql(1);
done();
})
.catch(function(err) {
done(err);
});
});
AFTER:
it('should handle a lucene query', function() {
var self = this;
return self.model
.esCount('name:jane')
.then(function(result) {
expect(result.count).to.eql(1);
});
});
Added commands npm run docker-v5
and npm run docker-v2
for creation docker images and starting them for testing purposes. In 1st terminal run npm run docker-v5
wait while elastic will be ready accept connections. After that in the 2nd terminal you may run tests.
Also removed timeout(5000)
in tests and add -t 10000
in package.json for all tests. Had failed tests due timeout with slow work of docker container.
Tomorrow I try to see what exactly failed in TravisCI and fix these problems. Today Travis has DB problems and does not show test logs 😰.
It's done! All tests migrated to ES6 with Node 4 support.
chore(packages): Add eslint, prettier and yarn.lock. Remove jshint. style(prettier): Apply prettier on all js files