Uh oh!
There was an error while loading. Please reload this page.
fix(browser): allow updating total specs count - #3264
Conversation
This change allows providing the total specs count after the tests have been started. The count will be updated in case it has been provided already. This can be uselful for some adapters where the total specs count can not be determined before starting the first test.
johnjbarton
commented
Feb 13, 2019
I guess the test is attempting to cover: However it tests something "not happening" and many things do not happen when code is changed. Maybe the event was originally |
| if (helper.isDefined(info.log)) { | ||
| this.emitter.emit('browser_log', this, info.log, info.type) | ||
| } else if (helper.isDefined(info.total)) { | ||
| this.lastResult.total = info.total |
There was a problem hiding this comment.
If you guard the update to results with state EXECUTING then the tests will pass. You can add a similar test with mock state EXECUTING to verify the change.
There was a problem hiding this comment.
In order to fix the test should ignore if browser not executing I would suggest to wrap all those if-clauses with a check for state EXECUTING.
Should this.refreshNoActivityTimeout() be still called then?
There was a problem hiding this comment.
I think we should log events in any state, they could be error messages for corner cases. So remove the line in the test that checks the .dump path.
The this.refreshNoActivityTimeout() should always be called, it signals that the browser is still on the line.
There was a problem hiding this comment.
Makes sense. I've pushed my changes.
johnjbarton
commented
Feb 13, 2019
Thanks! |
matz3
commented
Feb 14, 2019
Thanks for the quick handling 👍 |
This change allows providing the total specs count after the tests have
been started.
The count will be updated in case it has been provided already.
This can be uselful for some adapters where the total specs count can
not be determined before starting the first test.
Regarding tests
I wanted to update the tests and/or create a test case but the
onInfotests are not clear to me:So I would be happy to get feedback from you before writing a test case.
karma/test/unit/browser.spec.js
Lines 102 to 137 in c277a6b