-
Notifications
You must be signed in to change notification settings - Fork 76
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
[Training] Add unit test code for poller #497
Conversation
} | ||
|
||
|
||
} |
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.
Missing semicolon.
} | ||
PowerStatusAlertJob.prototype.determinePowerStatusAlert = function(){ | ||
var self = this; | ||
self.powerStateAlerter(data.chassisPower.status, data); |
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.
'data' is not defined.
assert, | ||
Errors, | ||
Promise, | ||
_ |
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.
'_' is defined but never used.
PowerStatusAlertJob.prototype.determinePowerStatusAlert = function(){ | ||
var self = this; | ||
self.powerStateAlerter(data.chassisPower.status, data); | ||
} |
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.
Missing semicolon.
self.determinePowerStatusAlert | ||
); | ||
|
||
} |
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.
Missing semicolon.
Background
Add unit test code for the new defined poller.
Result
execute command "npm test" in on-tasks repo
![image](https://user-images.githubusercontent.com/20394473/29347951-abaa5610-8282-11e7-9749-be916e24b65a.png)
code coverrage
![image](https://user-images.githubusercontent.com/20394473/29348093-ae5906e4-8283-11e7-9d28-828d2a3e23af.png)
Execute following command to get coverage
./node_modules/.bin/istanbul cover -x "/spec/" ./node_modules/.bin/_mocha -- $(find spec -name '*-spec.js') --timeout 10000 -R xunit-file --require spec/helper.js
original coverrage:
latest code coverrage
![image](https://user-images.githubusercontent.com/20394473/29348124-f3dbb4b4-8283-11e7-9589-0dacbb479933.png)
Execute the command "git checkout add-unittest-poller" . Then execute following command to get coverage.
./node_modules/.bin/istanbul cover -x "/spec/" ./node_modules/.bin/_mocha -- $(find spec -name '*-spec.js') --timeout 10000 -R xunit-file --require spec/helper.js
Reviewers
@iceiilin @anhou