Skip to content

Instantly share code, notes, and snippets.

@syshen
Created May 21, 2012 13:41
Show Gist options
  • Select an option

  • Save syshen/2762386 to your computer and use it in GitHub Desktop.

Select an option

Save syshen/2762386 to your computer and use it in GitHub Desktop.
describe('Strategy in round robin', function() {
describe("with one proxy setting", function() {
basic_options["backends"] = [
{
host: "127.0.0.1",
port: 8001,
https: false
}
];
var proxy = new lbProxy.LoadBalancingProxy(basic_options);
var strategy = new strategies.RoundRobinStrategy(proxy.proxies, basic_options);
it("should always return the first one", function(done) {
strategy(req, res, function(err, p) {
should.not.exist(err);
p.target.host.should.equal('127.0.0.1');
p.target.port.should.equal(8001);
done();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment