-
Notifications
You must be signed in to change notification settings - Fork 778
Rewrote all unit tests to use Mocha Chai instead of Tape. Fixes #237. #248
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
Rewrote all unit tests to use Mocha Chai instead of Tape. Fixes #237. #248
Conversation
1447730
to
9e5bc2e
Compare
9e5bc2e
to
2eec6af
Compare
I suggest that we add the gulpfile to the linter. |
"karma-phantomjs-launcher": "^0.2.1", | ||
"karma-sinon": "^1.0.4", | ||
"mocha": "^2.3.3", | ||
"phantomjs": "^1.9.18", | ||
"plato": "^1.4.0", |
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.
Are we still using this Plato?
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.
@AurelioDeRosa I thought I removed that. Not at the moment, but it might be good to add later. Agreed with adding Gulpfile to linter, will update commit with both fixes.
@AurelioDeRosa Quite agreed; have added all JS files and linted them all. |
8c9ba7a
to
a75eb14
Compare
@@ -38,7 +38,7 @@ | |||
"disallowYodaConditions": true, | |||
"maximumLineLength": 120, | |||
"requireBlocksOnNewline": true, | |||
"requireCamelCaseOrUpperCaseIdentifiers": true, | |||
"requireCamelCaseOrUpperCaseIdentifiers": false, |
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.
What are the exceptions in our naming conventions to disable this? Just wondering.
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.
Main reasons I disabled them were _request (dangling underscores) and "per_page" from GitHub's API (camelcase or upper).
Also removed requirement for curly brackets with if
statements because quite a few just return or whatever without them. I'm open to requiring if
s with curly brackets, but have just set this that way for the moment so linting passes.
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.
I see, good point. I think that in regard of _request
we can rename it wherever it's used because it isn't even private anymore. In regard of page, we can add an ad hoc exception on a specific line as we do with Istanbul. What do you think?
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.
@AurelioDeRosa Yep, agreed on renaming _request and re-enabling the check for dangling underscores. That's also a good suggestion re: ad hoc overriding where-ever GitHub uses an underscore for a space, will help prevent people from naming things badly.
For the moment though, can we leave _request as-is and save that for a separate PR? This one is already getting a bit unwieldy. 😄 Will update to re-enable requireCamelCase.
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.
Sounds good.
a75eb14
to
ca146fb
Compare
|
||
browsers: ['PhantomJS'], | ||
|
||
plugins: [ |
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 can be removed as mentioned in the documentation:
By default, Karma loads all sibling NPM modules which have a name starting with karma-*.
ca146fb
to
0d82b20
Compare
// Module dependencies | ||
var chai = require('chai'); | ||
var Github = require('../'); |
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.
I think we should explicitly call the file. This will be updated when we'll split in modules.
Closed by 1813b0d. |
This removes Tape and replaces it with Mocha + Chai + Sinon. Sinon might be unnecessary because we're testing against a real username/repo most of the time.