Skip to content
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

add a SwitchHistoryRule unit test #2181

Conversation

nicosang
Copy link
Contributor

@nicosang nicosang commented Sep 21, 2017

Hi,

in issue #2178, a division by zero has been detected, that is why a SwitchHistoryRule unit test is added. I don't know exactly what is expected because in javascript a division by zero returns INFINITY, not really an error.

Nico

it("should return an empty switchRequest when getMaxIndex function is called with an empty parameter", function () {
const switchRequest = switchHistoryRule.getMaxIndex();

expect(switchRequest.quality).to.be.equal(-1); // jshint ignore:line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicosang, thank you very much. PR looks great. Just one minor proposal. Could we use SwitchRequest.NO_CHANGE here instead of -1?

@epiclabsDASH epiclabsDASH merged commit 906cafd into Dash-Industry-Forum:development Sep 22, 2017
@nicosang nicosang deleted the addSwitchHistoryRuleUnitTest branch September 22, 2017 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants