MCPcopy
hub / github.com/request/request / runTest

Function runTest

tests/test-redirect-auth.js:69–81  ·  view source on GitHub ↗
(name, redir, expectAuth)

Source from the content-addressed store, hash-verified

67handleRequests(ss)
68
69function runTest (name, redir, expectAuth) {
70 tape('redirect to ' + name, function (t) {
71 request(redir.src, function (err, res, body) {
72 t.equal(err, null)
73 t.equal(res.request.uri.href, redir.dst)
74 t.equal(res.statusCode, 200)
75 t.equal(body, expectAuth
76 ? 'auth: Basic dGVzdDp0ZXN0aW5n'
77 : 'auth: (nothing)')
78 t.end()
79 })
80 })
81}
82
83function addTests () {
84 runTest('same host and protocol',

Callers 1

addTestsFunction · 0.70

Calls 1

requestFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…