Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
fix up
Browse files Browse the repository at this point in the history
  • Loading branch information
rostik404 committed Aug 31, 2016
1 parent c5e2508 commit 7797cd9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/runner/suite-runner/regular-suite-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = class RegularSuiteRunner extends SuiteRunner {
.then((browser) => this._initSession(browser))
.then(() => this._processStates(stateProcessor))
.catch((e) => {
this._handleError(e);
this._validateSession(e);

return this._passErrorToStates(e);
})
Expand Down Expand Up @@ -92,7 +92,7 @@ module.exports = class RegularSuiteRunner extends SuiteRunner {
return promiseUtils.seqMap(this._suite.states, (state) => this._runStateInSession(state, stateProcessor));
}

_handleError(error) {
_validateSession(error) {
if (!(error instanceof NoRefImageError)) {
this._browserAgent.invalidateSession();
}
Expand All @@ -112,7 +112,7 @@ module.exports = class RegularSuiteRunner extends SuiteRunner {
]);

runner.on(RunnerEvents.ERROR, (e) => {
this._handleError(e);
this._validateSession(e);

this.emit(RunnerEvents.ERROR, e);
});
Expand Down
2 changes: 1 addition & 1 deletion test/unit/runner/browser-runner/browser-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('runner/browser-runner/browser-agent', function() {
assert.calledWith(browserPool.freeBrowser, sinon.match.any, {force: true});
});

it('should free browser conditionally if session was not invalidated', () => {
it('should free browser if session was not invalidated', () => {
const browserAgent = BrowserAgent.create('browser', browserPool);

browserAgent.freeBrowser();
Expand Down
2 changes: 1 addition & 1 deletion test/unit/runner/suite-runner/regular-suite-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ describe('runner/suite-runner/regular-suite-runner', () => {
});
});

it('should not invalidate session after `NoRefImageError`', () => {
it('should not invalidate session if reference image does not exist', () => {
CaptureSession.prototype.runActions.returns(q.reject(new NoRefImageError()));

return run_()
Expand Down

0 comments on commit 7797cd9

Please sign in to comment.