MCPcopy Index your code
hub / github.com/molnarg/node-http2 / testFallbackProxyMethod

Function testFallbackProxyMethod

test/http.js:142–158  ·  view source on GitHub ↗
(name, originalArguments, done)

Source from the content-addressed store, hash-verified

140 });
141 describe('OutgoingRequest', function() {
142 function testFallbackProxyMethod(name, originalArguments, done) {
143 var request = new http2.OutgoingRequest();
144
145 // When in HTTP/2 mode, this call should be ignored
146 request.stream = { reset: util.noop };
147 request[name].apply(request, originalArguments);
148 delete request.stream;
149
150 // When in fallback mode, this call should be forwarded
151 request[name].apply(request, originalArguments);
152 var mockFallbackRequest = { on: util.noop };
153 mockFallbackRequest[name] = function() {
154 expect(Array.prototype.slice.call(arguments)).to.deep.equal(originalArguments);
155 done();
156 };
157 request._fallback(mockFallbackRequest);
158 }
159 describe('method `setNoDelay(noDelay)`', function() {
160 it('should act as a proxy for the backing HTTPS agent\'s `setNoDelay` method', function(done) {
161 testFallbackProxyMethod('setNoDelay', [true], done);

Callers 1

http.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected