Skip to content

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

Merged
merged 29 commits into from
Mar 1, 2018
Merged

Development #33

merged 29 commits into from
Mar 1, 2018

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

@@ -40,7 +40,8 @@ describe('TokenAPI WS', () => {
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.

4 participants