removed the requireRoot stuff form the unit tests which need to have vanilla require calls when bundled with browserify

This commit is contained in:
Spencer Alger
2014-02-05 10:14:59 -07:00
parent 70b51dfa6d
commit 7b795fc1a0

View File

@ -1,11 +1,7 @@
describe('Client instances creation', function () { describe('Client instances creation', function () {
var path = require('path'); var path = require('path');
var fromRoot = path.join.bind(path, require('find-root')(__dirname)); var es = require('../../../src/elasticsearch');
var rootRequire = function (path) { var apis = require('../../../src/lib/apis');
return require(fromRoot(path));
};
var es = rootRequire('src/elasticsearch');
var apis = rootRequire('src/lib/apis');
var expect = require('expect.js'); var expect = require('expect.js');
var client; var client;
@ -29,13 +25,13 @@ describe('Client instances creation', function () {
expect(client.cluster.nodeStats).to.eql(apis['0.90'].cluster.prototype.nodeStats); expect(client.cluster.nodeStats).to.eql(apis['0.90'].cluster.prototype.nodeStats);
}); });
it('inherits the master API when specified', function () { it('inherits the 1.0 API when specified', function () {
client.close(); client.close();
client = es.Client({ client = es.Client({
apiVersion: 'master' apiVersion: '1.0'
}); });
expect(client.bulk).to.eql(apis.master.bulk); expect(client.bulk).to.eql(apis['1.0'].bulk);
expect(client.nodes.stats).to.eql(apis.master.nodes.prototype.stats); expect(client.nodes.stats).to.eql(apis['1.0'].nodes.prototype.stats);
}); });
it('closing the client causes it\'s transport to be closed', function () { it('closing the client causes it\'s transport to be closed', function () {