MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / apiTest

Function apiTest

tests/unit/tasks/server/express-server-test.js:443–459  ·  view source on GitHub ↗
(app, method, url, done)

Source from the content-addressed store, hash-verified

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);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…