File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ describe('screenshotOnFail', () => {
2222 } )
2323 } )
2424
25+ afterEach ( ( ) => {
26+ event . dispatcher . removeAllListeners ( event . test . failed )
27+ } )
28+
2529 it ( 'should remove the . at the end of test title' , async ( ) => {
2630 screenshotOnFail ( { } )
2731 event . dispatcher . emit ( event . test . failed , createTest ( 'test title.' ) )
@@ -68,7 +72,7 @@ describe('screenshotOnFail', () => {
6872 await recorder . promise ( )
6973 expect ( screenshotSaved . called ) . is . ok
7074 const fileName = screenshotSaved . getCall ( 0 ) . args [ 0 ]
71- const regexpFileName = / t e s t 1 _ [ 0 - 9 ] { 10 } .f a i l e d .p n g /
75+ const regexpFileName = / t e s t 1 _ [ 0 - 9 ] { 13 } .f a i l e d .p n g /
7276
7377 expect ( fileName . match ( regexpFileName ) . length ) . is . equal ( 1 )
7478 } )
@@ -145,6 +149,10 @@ describe('screenshotOnFail', () => {
145149 } )
146150 } )
147151
152+ afterEach ( ( ) => {
153+ event . dispatcher . removeAllListeners ( event . test . failed )
154+ } )
155+
148156 it ( 'should generate unique screenshot names for Data() iterations with uniqueScreenshotNames: true' , async ( ) => {
149157 screenshotOnFail ( { uniqueScreenshotNames : true } )
150158
You can’t perform that action at this time.
0 commit comments