Skip to content

Conversation

@itrambovetskyi
Copy link
Collaborator

Unit tests
Integration tests
Autoupdating session
Slight code improvements

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])
Copy link

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]);
Copy link

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 => {
Copy link

@Merisho Merisho Feb 27, 2018

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 => {
Copy link

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


// Configaratuion DeviceHive
deviceHive = new DeviceHive({
login: `dhadmin`,
Copy link

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

Copy link
Collaborator Author

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.

@itrambovetskyi itrambovetskyi merged commit 85f1db4 into master Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants