@@ -50,14 +50,7 @@ const createTestRunner = (data: TT.Tutorial, callbacks: Callbacks) => {
5050 return
5151 }
5252
53- console . log ( 'STEP' )
54- console . log ( JSON . stringify ( step ) )
55-
56- // flag as running
57- // no need to flag subtasks as running
58- if ( ! step . setup ?. subtasks ) {
59- callbacks . onRun ( position )
60- }
53+ callbacks . onRun ( position )
6154
6255 let result : { stdout : string | undefined ; stderr : string | undefined }
6356 try {
@@ -98,16 +91,6 @@ const createTestRunner = (data: TT.Tutorial, callbacks: Callbacks) => {
9891
9992 const tap : ParserOutput = parser ( stdout || '' )
10093
101- if ( step . setup . subtasks ) {
102- const summary = parseSubtasks ( tap . summary , position . stepId || '' )
103-
104- console . log ( '---subtask summary' )
105- console . log ( summary )
106- callbacks . onLoadSubtasks ( { summary } )
107- // exit early
108- return
109- }
110-
11194 addOutput ( { channel : logChannelName , text : tap . logs . join ( '\n' ) , show : false } )
11295
11396 if ( stderr ) {
@@ -128,7 +111,18 @@ const createTestRunner = (data: TT.Tutorial, callbacks: Callbacks) => {
128111 description : firstFail . details || 'Unknown error' ,
129112 summary : tap . summary ,
130113 }
131- callbacks . onFail ( position , failSummary )
114+
115+ if ( step . setup . subtasks ) {
116+ const subtaskSummary = parseSubtasks ( tap . summary , position . stepId || '' )
117+
118+ callbacks . onFail ( position , {
119+ ...failSummary ,
120+ summary : subtaskSummary ,
121+ } )
122+ } else {
123+ callbacks . onFail ( position , failSummary )
124+ }
125+
132126 const output = formatFailOutput ( tap )
133127 addOutput ( { channel : failChannelName , text : output , show : true } )
134128 return
@@ -142,13 +136,15 @@ const createTestRunner = (data: TT.Tutorial, callbacks: Callbacks) => {
142136
143137 // PASS
144138 if ( tap . ok ) {
139+ console . log ( 'running pass' )
145140 clearOutput ( failChannelName )
146141
147142 callbacks . onSuccess ( position )
148143
149144 if ( onSuccess ) {
150145 onSuccess ( )
151146 }
147+ 5
152148 } else {
153149 // should never get here
154150 onError ( new Error ( `Error with running test ${ JSON . stringify ( position ) } ` ) )
0 commit comments