-
Notifications
You must be signed in to change notification settings - Fork 12
test: migrate RemoteError tests to tap #167
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
Conversation
a38e726 to
eb0ed8d
Compare
|
@metarhia/jstp-core ping |
| const jstp = require('../../../'); | ||
|
|
||
| module.exports = Object.keys(jstp) | ||
| .filter(key => key.startsWith('ERR_')) |
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.
These should be hardcoded instead of dynamically introspected.
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.
@aqrln this test is for checking that every jstp error has a default message. Thus introspection is needed here in case someone adds new jstp error but forgets to add a default message.
| @@ -0,0 +1,42 @@ | |||
| 'use strict'; | |||
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 don't actually see any reason for the whole fixtures/remote-error-test-cases directory to exist. These files are not pure data, they contain quite a bit of imperative logic, and they are very small and isolated. I'd say their contents should be simply moved to the corresponding tests.
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.
@aqrln Thank you for your review.
I have added changes due to it, although I do not see a lot of imperative logic:
- scanning for default error messages
- calling a
RemoteErrorandTypeErrorconstructor
Both moved to a related test.
|
@aqrln ping |
aqrln
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, thanks
|
Landed in 5ea6001. |
PR-URL: metarhia/jstp#167 Refs: metarhia/jstp#145 Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
PR-URL: metarhia/jstp#167 Refs: metarhia/jstp#145 Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Refs: #145