-
Notifications
You must be signed in to change notification settings - Fork 5
Development #33
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
Development #33
Conversation
HTTP api transport improvement
Autoupdate session
Promise.all([httpDeviceHive.configuration.get(testConfigurations[0].name), wsDeviceHive.configuration.get(testConfigurations[1].name)]) | ||
.then(dataAll => { | ||
for (const key in dataAll) { | ||
assert.isObject(dataAll[key]) |
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.
Please avoid assertions in loop
.then(dataAll => { | ||
for (const key in dataAll) { | ||
assert.isObject(dataAll[key]) | ||
assert.include(dataAll[key], testConfigurations[key]); |
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.
Also try to use constants as expected values to make assertion more clear
}); | ||
|
||
|
||
it('DeviceCommandAPI.insert()', done => { |
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.
Please specify in test name what method (DeviceCommandAPI.insert()) should do/return
}); | ||
|
||
|
||
it('DeviceCommandAPI.wait()', done => { |
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.
You can omit second argument of it() and leave only test name so mocha will mark it as TODO for you
@@ -40,7 +40,8 @@ describe('TokenAPI WS', () => { | |||
deviceHive = new DeviceHive({ | |||
login: `dhadmin`, |
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.
We can move test configuration for connection in separate file to reuse in each test
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 configuration is related to some stub servers in tests, so, from my perspective it would be better to leave connection configuration in the same file as stubs configuration, until stubs would be reworked.
Integration tests improvements
Integration tests improvements
Unit tests
Integration tests
Autoupdating session
Slight code improvements