Skip to content

Feature/on reset #388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 12, 2020
Next Next commit
setup reset script
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Jul 12, 2020
commit cc029cfbc1333eb8bbf3610718c3e8640a201467
3 changes: 3 additions & 0 deletions src/channel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ class Channel implements Channel {
case 'EDITOR_RUN_TEST':
vscode.commands.executeCommand(COMMANDS.RUN_TEST, action?.payload)
return
case 'EDITOR_RUN_RESET_SCRIPT':
// if tutorial.config.reset.command, run it
return
default:
logger(`No match for action type: ${actionType}`)
return
Expand Down
5 changes: 5 additions & 0 deletions web-app/src/services/state/actions/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,9 @@ export default (editorSend: any) => ({
payload: { position: context.position },
})
},
runResetScript() {
editorSend({
type: 'EDITOR_RUN_RESET_SCRIPT',
})
},
})
3 changes: 3 additions & 0 deletions web-app/src/services/state/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ export const createMachine = (options: any) => {
RUN_TEST: {
actions: ['runTest'],
},
RESET_SCRIPT: {
actions: ['runResetScript'],
},
},
},
TestRunning: {
Expand Down