-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GithubApiProvider: injectible interface for code that calls [github] (also affects [suggest php-eye travis]) #1812
Conversation
Generated by 🚫 dangerJS |
server.js
Outdated
'User-Agent': 'Shields.io', | ||
'Accept': 'application/vnd.github.drax-preview+json' | ||
}; | ||
request(apiUrl, { headers: customHeaders }, function(err, res, buffer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be obsolete auth code which preceded githubAuth.
# Conflicts: # server.js
# Conflicts: # server.js
In order to try out a PaaS, it's going to be important to make our Github token persistence platform-friendly, which means closing out the work of #1205. That's still a really hairy PR, and getting this in is the next step in paring it down. |
it('should invoke the callback', function(done) { | ||
provider.request(mockRequest, '/foo', {}, (err, res, buffer) => { | ||
expect(err).to.equal(null); | ||
// Add more? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would having a test with a non null
error be useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't hurt. I will add one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed, this looks like a good start to me! 😉
This interface was designed as part of the work in #1205. Right now it's just a wrapper around the legacy code, though it facilitates making this all dependency-injectible. This is the interface between the github logic and the badge code, so it grabs the bulk of the miscellaneous changes from that WIP PR.
See also #1205 (comment)