-
Notifications
You must be signed in to change notification settings - Fork 1
Add tests to proxy #5
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
base: master
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| function createError(errMsg) { | ||
| callback(new Error('Error while trying to call platform endpoint ' + endpoint + errMsg)); |
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.
need another space i think
| var query = "dummy-query"; | ||
| var token = "dummy-token"; | ||
|
|
||
| it("WhenResponseReturnWithError_ShouldCallCallbackWithError", sinon.test(function() { |
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.
use spaces- more readable
| var dummyErrorMessage = "dummy-error-message"; | ||
| var expectedError = new Error("Error while trying to call platform endpoint " + endpoint + " : " + dummyErrorMessage); | ||
|
|
||
| SetResponseWithError(this, dummyErrorMessage); |
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.
camelCase
| proxy.callEndpoint(appId, appSecret, endpoint, query, token, callback); | ||
|
|
||
| sinon.assert.calledOnce(callback); | ||
| sinon.assert.calledWith(callback, sinon.match.same(null), sinon.match(expectedBody)); |
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.
to make it clearer that sinon.match.same(null) mean that errback was not called, consider putting it in a variable with a meaningful name
| "devDependencies": {}, | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| "test": "./node_modules/.bin/mocha test/mocha" |
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.
"test": "mocha test" should work.
might need to remove the mocha subfolder
cowchimp
left a comment
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.
lgtm
No description provided.