Files
elasticsearch-js/test/unit/specs/round_robin_selector.js
2017-06-14 18:48:24 -07:00

18 lines
498 B
JavaScript

describe('Round Robin Selector', function () {
const selector = require('../../../src/lib/selectors/round_robin');
const _ = require('lodash');
const expect = require('expect.js');
it('chooses options in order', function () {
const options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
const expected = _.clone(options);
const selections = [];
_.times(options.length, function () {
selections.push(selector(options));
});
expect(selections).to.eql(expected);
});
});