You can use Jasmine or Mocha as testing frameworks for Node.js. Within the test suites you can use another library: superagent.
Superagent allows you to perform HTTP requests to a specified url.
On the other hand you have an elasticsearch that receives HTTP requests.
You can have a library of data sets in the form of http requests to issue towards elasticsearch. Each data set will be suitable to feed elasticsearch to check wether or not a test passes or fails.
Here is an example of how superagent can be used to issue a request to an elasticsearch server:
var request = require('superagent');
var should = require('should.js');
describe('Your test suite', function () {
it('Should test elasticsearch search', function (done) {
request.get('http://localhost:9002/index/type/_search')
.end(function (err, res) {
should.not.exist(err);
should.exist(res);
});
});
});