Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9eaa01f

Browse files
committed
state machine test progress
1 parent78e1467 commit9eaa01f

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

‎src/state/actions/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default {
8989
vscode.commands.executeCommand('coderoad.run_test')
9090
},
9191
testPass(){
92-
vscode.window.showWarningMessage('FAIL')
92+
vscode.window.showInformationMessage('PASS')
9393
},
9494
testFail(){
9595
vscode.window.showWarningMessage('FAIL')
@@ -148,4 +148,7 @@ export default {
148148
returnnextProgress
149149
}
150150
}),
151+
stepLoadNext(){
152+
console.log("LOAD NEXT STEP")
153+
}
151154
}

‎src/state/machine.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const machine = Machine<
5050
ContinueTutorial:{
5151
onEntry:['tutorialContinue'],
5252
on:{
53-
TUTORIAL_START:'#tutorial-load-next'
53+
TUTORIAL_START:'#tutorial-load-next-stage'
5454
}
5555
},
5656
}
@@ -60,8 +60,8 @@ export const machine = Machine<
6060
initial:'Summary',
6161
onEntry:['tutorialSetup'],
6262
states:{
63-
LoadNext:{
64-
id:'tutorial-load-next',
63+
LoadNextStage:{
64+
id:'tutorial-load-next-stage',
6565
onEntry:['tutorialLoadNext'],
6666
on:{
6767
LOAD_NEXT:[
@@ -117,16 +117,14 @@ export const machine = Machine<
117117
},
118118
TestPass:{
119119
onEntry:['testPass','stepComplete'],
120+
after:{
121+
0:{
122+
target:'StepNext',
123+
cond:'hasNextStep',
124+
}
125+
},
120126
on:{
121-
NEXT:[
122-
{
123-
target:'StageNormal',
124-
cond:'hasNextStep',
125-
},
126-
{
127-
target:'StageComplete',
128-
},
129-
],
127+
NEXT:'StageComplete',
130128
},
131129
},
132130
TestFail:{
@@ -135,6 +133,12 @@ export const machine = Machine<
135133
0:'StageNormal'
136134
},
137135
},
136+
StepNext:{
137+
onEntry:['stepLoadNext'],
138+
after:{
139+
0:'StageNormal'
140+
}
141+
},
138142
StageComplete:{
139143
onEntry:'stageComplete',
140144
on:{

‎typings/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export interface MachineStateSchema {
146146
}
147147
Tutorial:{
148148
states:{
149-
LoadNext:{}
149+
LoadNextStage:{}
150150
Summary:{}
151151
Level:{}
152152
Stage:{
@@ -155,6 +155,7 @@ export interface MachineStateSchema {
155155
TestRunning:{}
156156
TestPass:{}
157157
TestFail:{}
158+
StepNext:{}
158159
StageComplete:{}
159160
}
160161
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp