@@ -18,18 +18,19 @@ class Channel {
1818 const editor = acquireVsCodeApi ( )
1919 this . editorSend = editor . postMessage
2020 }
21- public machineSend = ( action : Action | string ) => console . log ( 'machine send' )
22- public editorSend = ( action : Action ) => console . log ( 'editor send' )
21+ public machineSend = ( action : Action | string ) => { /* */ }
22+ public editorSend = ( action : Action ) => { /* */ }
2323
24- public setMachineSend ( send : any ) {
24+ public setMachineSend = ( send : any ) => {
2525 this . machineSend = send
2626 }
27- public receive ( event : ReceivedEvent ) {
27+ public receive = ( event : ReceivedEvent ) => {
28+ console . log ( 'CLIENT RECEIVE' )
2829 const action = event . data
2930
3031 // @ts -ignore // ignore browser events from plugins
3132 if ( action . source ) { return }
32-
33+ console . log ( `CLIENT RECEIVE: ${ action . type } ` , action )
3334 // messages from core
3435 switch ( action . type ) {
3536 case 'TUTORIAL_LOADED' :
@@ -38,12 +39,16 @@ class Channel {
3839 console . log ( 'send action to state machine' )
3940 return
4041 case 'TEST_PASS' :
42+ // { type: 'TEST_PASS', payload: { stepId: string }}
4143 this . machineSend ( action )
4244 console . log ( 'test passed' )
4345 return
4446 case 'TEST_FAIL' :
4547 this . machineSend ( action )
4648 return
49+ case 'TEST_RUN' :
50+ console . log ( 'TEST_RUN' )
51+ return
4752 case 'ACTIONS_LOADED' :
4853 console . log ( 'ACTIONS_LOADED' )
4954 return
@@ -56,29 +61,3 @@ class Channel {
5661}
5762
5863export default new Channel ( )
59-
60- // Send to Editor
61- // export const send = (action: Action) => {
62- // return
63- // }
64-
65-
66-
67- // // Receive from Editor
68- // export const receive = (event: ReceivedEvent): void => {
69-
70-
71- // // if (message.type === 'SET_DATA') {
72- // // // SET_DATA - set state machine context
73- // // console.log('SET_DATA updated')
74- // // const {progress, position} = message.payload
75- // // if (process.env.REACT_APP_DEBUG) {
76- // // console.log(`Position: ${position.levelId}/${position.stageId}/${position.stepId}`)
77- // // // setDebuggerInfo({ progress, position })
78- // // }
79- // // console.log('set currentTutorial')
80- // // // currentTutorial.set({position, progress})
81-
82- // // }
83- // }
84-
0 commit comments