+
Skip to content

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

Closed

Conversation

aendra-rininsland
Copy link
Member

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.

@AurelioDeRosa
Copy link
Member

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",
Copy link
Member

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?

Copy link
Member Author

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.

@aendra-rininsland
Copy link
Member Author

@AurelioDeRosa Quite agreed; have added all JS files and linted them all.

@@ -38,7 +38,7 @@
"disallowYodaConditions": true,
"maximumLineLength": 120,
"requireBlocksOnNewline": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCamelCaseOrUpperCaseIdentifiers": false,
Copy link
Member

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.

Copy link
Member Author

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 ifs with curly brackets, but have just set this that way for the moment so linting passes.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.


browsers: ['PhantomJS'],

plugins: [
Copy link
Member

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-*.

// Module dependencies
var chai = require('chai');
var Github = require('../');
Copy link
Member

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.

@aendra-rininsland
Copy link
Member Author

Closed by 1813b0d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载