(app, method, url, done)
| 441 | }); |
| 442 | |
| 443 | function apiTest(app, method, url, done) { |
| 444 | let req = request(app); |
| 445 | return req[method] |
| 446 | .call(req, url) |
| 447 | .set('content-length', 0) |
| 448 | .set('accept', 'text/json') |
| 449 | .end(function (err) { |
| 450 | if (err) { |
| 451 | return done(err); |
| 452 | } |
| 453 | |
| 454 | expect(proxy.called, 'proxy receives the request').to.equal(true); |
| 455 | expect(proxy.lastReq.method).to.equal(method.toUpperCase()); |
| 456 | expect(proxy.lastReq.url).to.equal(url); |
| 457 | done(); |
| 458 | }); |
| 459 | } |
| 460 | |
| 461 | it('proxies GET', function (done) { |
| 462 | apiTest(subject.app, 'get', '/api/get', done); |
no outgoing calls
no test coverage detected
searching dependent graphs…