()
| 247 | 'Should correctly retry while pending': function(test) { |
| 248 | var counter = 0, request; |
| 249 | function command() { |
| 250 | var args = [].slice.call(arguments); |
| 251 | var method = args.shift(); |
| 252 | if (method) { |
| 253 | setTimeout(function() { |
| 254 | request[method](); |
| 255 | command.apply(null, args); |
| 256 | }, 50); |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | request = rest.get(host, { headers: { 'x-delay': '1000' } }).on('complete', function() { |
| 261 | if (++counter < 3) { |