prose / gatekeeper

Enables client-side applications to dance OAuth with GitHub.
MIT License
761 stars 183 forks source link

add first test suite #44

Closed kriswep closed 7 years ago

kriswep commented 7 years ago

This PR belongs to issue #40. Added a basic test suite was added using tape and supertest.

GitHub API responses where mocked with nock.

As a start, I added test cases for calls to the authenticate route with a valid and an invalid GH code.

Note: in order for supertest to work, we have to export the express app before it is bound to any port. That's why I refactored the listen call in an extra index.js file, which requires server.js and gets picked up by npm start.

How to run:

Any further suggestions?

dereklieu commented 7 years ago

@kriswep 👍 my personal preference is to remove lines of code that are redundant/no longer needed, instead of commenting out. I think this just makes things easier to work with. If you could do that, I'll merge this after that and also turn on circleci.

kriswep commented 7 years ago

Added most of the suggested changes. Only thing I did not do (yet) were changes to the readme. Since there is no section about development, I would like to do that as a seperate task.