File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,15 @@ export default class DevToolsHookService implements Services.ServiceInstance {
139139 this . #commandStack = [ ]
140140 }
141141
142+ /**
143+ * Hook for Mocha/Jasmine.
144+ * It does the exact same thing as beforeScenario.
145+ */
146+ beforeTest ( ) {
147+ this . #lastCommandSig = null
148+ this . #commandStack = [ ]
149+ }
150+
142151 async beforeCommand ( command : string , args : string [ ] ) {
143152 if ( ! this . #browser) { return }
144153
Original file line number Diff line number Diff line change @@ -29,9 +29,20 @@ export class TestReporter extends WebdriverIOReporter {
2929 }
3030
3131 #sendUpstream ( ) {
32- const [ uid , suite ] = Object . entries ( this . suites ) . find ( ( [ uid ] ) => isNaN ( parseInt ( uid ) ) ) || [ ]
33- if ( uid && suite ) {
34- this . #report( [ { [ uid ] : suite } ] )
32+ if ( ! this . suites ) {
33+ return
34+ }
35+
36+ const payload : Record < string , SuiteStats > [ ] = [ ]
37+
38+ for ( const [ uid , suite ] of Object . entries ( this . suites ) ) {
39+ if ( suite ) {
40+ payload . push ( { [ uid ] : suite } )
41+ }
42+ }
43+
44+ if ( payload . length > 0 ) {
45+ this . #report( payload )
3546 }
3647 }
3748
You can’t perform that action at this time.
0 commit comments