This repository was archived by the owner on Sep 21, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ module.exports = class TestsRunner extends Runner {
2424 this . coverage = this . config . isCoverageEnabled ( ) && Coverage . create ( config ) ;
2525
2626 this . _stateProcessor = stateProcessor ;
27+
2728 this . _stats = RunnerStats . create ( ) ;
29+ this . _stats . attachRunner ( this ) ;
2830
2931 this . _browserPool = pool . create ( this . config , this ) ;
3032
@@ -87,7 +89,6 @@ module.exports = class TestsRunner extends Runner {
8789 Events . WARNING ,
8890 Events . ERROR
8991 ] ) ;
90- this . _stats . attachRunner ( runner ) ;
9192
9293 runner . on ( Events . END_SUITE , ( data ) => this . _suiteMonitor . suiteFinished ( data . suite , data . browserId ) ) ;
9394
Original file line number Diff line number Diff line change @@ -260,6 +260,18 @@ describe('runner', () => {
260260 . then ( ( ) => assert . equal ( testsStatistic . total , 2 ) ) ;
261261 } ) ;
262262
263+ it ( 'should include tests state data emitted from main runner to the statistic' , ( ) => {
264+ const runner = createRunner ( ) ;
265+
266+ runner . emit ( Events . ERROR , makeStateResult ( { name : 'some-name' } ) ) ;
267+
268+ let testsStatistic ;
269+ runner . on ( Events . END , ( stat ) => testsStatistic = stat ) ;
270+
271+ return run ( runner )
272+ . then ( ( ) => assert . equal ( testsStatistic . total , 1 ) ) ;
273+ } ) ;
274+
263275 it ( 'should not be immediately rejected if running of tests in some browser was rejected' , ( ) => {
264276 const runner = createRunner ( ) ;
265277 const rejected = q . reject ( ) ;
You can’t perform that action at this time.
0 commit comments