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

Commit 2c22d1d

Browse files
committed
feat: remove deprecated BEGIN_SESSION and END_SESSION events
1 parent d06a913 commit 2c22d1d

File tree

4 files changed

+1
-39
lines changed

4 files changed

+1
-39
lines changed

lib/constants/events.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ module.exports = {
99
BEGIN: 'begin',
1010
END: 'end',
1111

12-
BEGIN_SESSION: 'beginSession', // Deprecated, will be removed in the next major version - 5.0.0
13-
END_SESSION: 'endSession', // Deprecated, will be removed in the next major version - 5.0.0
14-
1512
RETRY: 'retry',
1613

1714
START_BROWSER: 'startBrowser',

lib/runner/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,10 @@ module.exports = class TestsRunner extends Runner {
5858
}
5959

6060
_runTests(suiteCollection) {
61-
this.emit(Events.BEGIN_SESSION);
62-
6361
return _(this._getBrowsersToRun())
6462
.map((browserId) => this._runTestsInBrowser(suiteCollection, browserId))
6563
.thru(promiseUtils.waitForResults)
66-
.value()
67-
.finally(() => this.emit(Events.END_SESSION));
64+
.value();
6865
}
6966

7067
_getBrowsersToRun() {

test/unit/gemini.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ describe('gemini', () => {
7979
Events.BEGIN,
8080
Events.END,
8181

82-
Events.BEGIN_SESSION,
83-
Events.END_SESSION,
84-
8582
Events.RETRY,
8683

8784
Events.START_BROWSER,

test/unit/runner/index.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,6 @@ describe('runner', () => {
196196
return run(runner).then(() => assert.callOrder(stateProcessor.prepare, BrowserRunner.prototype.run));
197197
});
198198

199-
it('should emit "BEGIN_SESSION" before running of tests', () => {
200-
const runner = createRunner();
201-
const onBeginSession = sinon.spy().named('onBeginSession');
202-
203-
runner.on(Events.BEGIN_SESSION, onBeginSession);
204-
205-
return run(runner).then(() => assert.calledOnce(onBeginSession));
206-
});
207-
208199
it('should create all browser runners', () => {
209200
pool.create.returns('some-pool');
210201

@@ -298,26 +289,6 @@ describe('runner', () => {
298289
return assert.isRejected(run(runner), /first-runner/);
299290
});
300291

301-
it('should emit "END_SESSION" event after running of tests', () => {
302-
const runner = createRunner();
303-
const onEndSession = sinon.spy().named('onEndSession');
304-
305-
runner.on(Events.END_SESSION, onEndSession);
306-
307-
return run(runner).then(() => assert.callOrder(BrowserRunner.prototype.run, onEndSession));
308-
});
309-
310-
it('should unconditionally emit "END_SESSION" event even if running of tests was rejected', () => {
311-
const runner = createRunner();
312-
const onEndSession = sinon.spy().named('onEndSession');
313-
314-
runner.on(Events.END_SESSION, onEndSession);
315-
316-
BrowserRunner.prototype.run.returns(q.reject());
317-
318-
return run(runner).catch(() => assert.calledOnce(onEndSession));
319-
});
320-
321292
it('should collect coverage', () => {
322293
const runner = createRunner({config: stubConfig({isCoverageEnabled: true})});
323294

0 commit comments

Comments
 (0)