@@ -27,12 +27,6 @@ describe('Stats', () => {
2727 assert . equal ( stats . getResult ( ) . warned , 1 ) ;
2828 } ) ;
2929
30- it ( 'should count errored tests' , ( ) => {
31- runner . emit ( RunnerEvents . ERROR , makeStateResult ( ) ) ;
32-
33- assert . equal ( stats . getResult ( ) . errored , 1 ) ;
34- } ) ;
35-
3630 it ( 'should count updated tests' , ( ) => {
3731 runner . emit ( RunnerEvents . UPDATE_RESULT , makeStateResult ( { updated : true } ) ) ;
3832
@@ -45,6 +39,12 @@ describe('Stats', () => {
4539 assert . equal ( stats . getResult ( ) . passed , 1 ) ;
4640 } ) ;
4741
42+ it ( 'should count failed tests on "ERROR" event' , ( ) => {
43+ runner . emit ( RunnerEvents . ERROR , makeStateResult ( ) ) ;
44+
45+ assert . equal ( stats . getResult ( ) . failed , 1 ) ;
46+ } ) ;
47+
4848 it ( 'should count failed tests on "TEST_RESULT" event' , ( ) => {
4949 runner . emit ( RunnerEvents . TEST_RESULT , makeStateResult ( { equal : false } ) ) ;
5050
@@ -79,7 +79,7 @@ describe('Stats', () => {
7979 assert . equal ( stats . getResult ( ) . total , 2 ) ;
8080 } ) ;
8181
82- it ( 'should getResult full stat ' , ( ) => {
82+ it ( 'should return correct full statistic ' , ( ) => {
8383 runner . emit ( RunnerEvents . UPDATE_RESULT , makeStateResult ( { updated : true , name : 'updated' } ) ) ;
8484 runner . emit ( RunnerEvents . RETRY , makeStateResult ( { name : 'passed' } ) ) ;
8585 runner . emit ( RunnerEvents . TEST_RESULT , makeStateResult ( { equal : true , name : 'passed' } ) ) ;
@@ -92,8 +92,7 @@ describe('Stats', () => {
9292 total : 6 ,
9393 updated : 1 ,
9494 passed : 1 ,
95- failed : 1 ,
96- errored : 1 ,
95+ failed : 2 ,
9796 skipped : 1 ,
9897 warned : 1 ,
9998 retries : 1
@@ -105,7 +104,7 @@ describe('Stats', () => {
105104 runner . emit ( RunnerEvents . ERROR , makeStateResult ( { name : 'some-state' } ) ) ;
106105
107106 assert . equal ( stats . getResult ( ) . skipped , 0 ) ;
108- assert . equal ( stats . getResult ( ) . errored , 1 ) ;
107+ assert . equal ( stats . getResult ( ) . failed , 1 ) ;
109108 } ) ;
110109
111110 it ( 'should not count test result twice for same state and browser' , ( ) => {
@@ -118,10 +117,10 @@ describe('Stats', () => {
118117 runner . emit ( RunnerEvents . ERROR , test ) ;
119118
120119 assert . equal ( stats . getResult ( ) . total , 1 ) ;
121- assert . equal ( stats . getResult ( ) . errored , 1 ) ;
120+ assert . equal ( stats . getResult ( ) . failed , 1 ) ;
122121 } ) ;
123122
124- it ( 'should create suite key by suite full name and suite browser id divided by space ' , ( ) => {
123+ it ( 'should correctly handle tests with the similar titles ' , ( ) => {
125124 const test1 = makeStateResult ( {
126125 suite : { fullName : 'some case' } ,
127126 browserId : 'bro'
@@ -135,6 +134,6 @@ describe('Stats', () => {
135134 runner . emit ( RunnerEvents . ERROR , test2 ) ;
136135
137136 assert . equal ( stats . getResult ( ) . total , 2 ) ;
138- assert . equal ( stats . getResult ( ) . errored , 2 ) ;
137+ assert . equal ( stats . getResult ( ) . failed , 2 ) ;
139138 } ) ;
140139} ) ;
0 commit comments