@@ -18,18 +18,19 @@ class Channel {
1818const editor = acquireVsCodeApi ( )
1919this . 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 ) => {
2525this . machineSend = send
2626}
27- public receive ( event :ReceivedEvent ) {
27+ public receive = ( event :ReceivedEvent ) => {
28+ console . log ( 'CLIENT RECEIVE' )
2829const action = event . data
2930
3031//@ts -ignore // ignore browser events from plugins
3132if ( action . source ) { return }
32-
33+ console . log ( `CLIENT RECEIVE: ${ action . type } ` , action )
3334// messages from core
3435switch ( action . type ) {
3536case 'TUTORIAL_LOADED' :
@@ -38,12 +39,16 @@ class Channel {
3839console . log ( 'send action to state machine' )
3940return
4041case 'TEST_PASS' :
42+ // { type: 'TEST_PASS', payload: { stepId: string }}
4143this . machineSend ( action )
4244console . log ( 'test passed' )
4345return
4446case 'TEST_FAIL' :
4547this . machineSend ( action )
4648return
49+ case 'TEST_RUN' :
50+ console . log ( 'TEST_RUN' )
51+ return
4752case 'ACTIONS_LOADED' :
4853console . log ( 'ACTIONS_LOADED' )
4954return
@@ -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-