test(unit): add unit test for basic searc

This commit is contained in:
Juan Picado @jotadeveloper 2018-01-28 18:58:51 +01:00
parent 7c717359fc
commit c08f257bf1
No known key found for this signature in database
GPG Key ID: 18AC54485952D158
1 changed files with 22 additions and 0 deletions

View File

@ -424,4 +424,26 @@ describe('endpoint unit test', () => {
});
describe('should test search api', () => {
test('should perform a search', (done) => {
const now = Date.now()
const cacheTime = now - 6000000;
request(app)
.get('/-/all/since?stale=update_after&startkey=' + cacheTime)
// .set('accept-encoding', 'application/json')
// .set('content-type', 'application/json')
//.expect('Content-Type', /json/)
.expect(200)
.end(function(err, res) {
if (err) {
return done(err);
}
//TODO: we have to catch the stream check whether it returns something
// we should not spend much time on this api since is deprecated somehow.
done();
});
});
});
});