Closed kriswep closed 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.
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.
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 requiresserver.js
and gets picked up bynpm start
.How to run:
npm install
npm run test
Any further suggestions?