diff --git a/lib/index.js b/lib/index.js index 23e349c5..bb413f86 100644 --- a/lib/index.js +++ b/lib/index.js @@ -166,6 +166,8 @@ function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { return Promise.resolve(body).then(doFetch) } +module.exports.getAuth = getAuth + module.exports.json = fetchJSON function fetchJSON (uri, opts) { return regFetch(uri, opts).then(res => res.json()) diff --git a/test/auth.js b/test/auth.js index 1d786bec..5e88f312 100644 --- a/test/auth.js +++ b/test/auth.js @@ -571,3 +571,7 @@ t.test('registry host matches, path does not, send auth', t => { }) t.end() }) + +t.test('getAuth is exported', async t => { + t.equal(fetch.getAuth, getAuth) +})