Created
May 21, 2012 13:41
-
-
Save syshen/2762386 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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