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
/dobPublic

Commit7a3b91e

Browse files
committed
fix test's bug
1 parent8523958 commit7a3b91e

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

‎tests/debug.test.ts‎

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,14 @@ test("test callstack", async t => {
9898
}
9999

100100
conststore=newStore()
101+
letonce=true
101102
letcallStack:PropertyKey[]=[]
102103

103104
dobEvent.on("debug",debugInfo=>{
105+
if(!once){
106+
return
107+
}
108+
once=false
104109
callStack=debugInfo.changeList[0].callStack
105110
})
106111

@@ -109,7 +114,7 @@ test("test callstack", async t => {
109114
stopDebug()
110115

111116
returnimmediate(()=>t.true(callStack.length===6))
112-
},20)
117+
},0)
113118
})
114119

115120
test("test overflow callstack",asynct=>{
@@ -134,9 +139,14 @@ test("test overflow callstack", async t => {
134139
}
135140

136141
conststore=newStore()
142+
letonce=true
137143
letcallStack:PropertyKey[]=[]
138144

139145
dobEvent.on("debug",debugInfo=>{
146+
if(!once){
147+
return
148+
}
149+
once=false
140150
callStack=debugInfo.changeList[0].callStack
141151
})
142152

@@ -147,7 +157,7 @@ test("test overflow callstack", async t => {
147157
globalState.getCallstackMaxCount=50
148158

149159
returnimmediate(()=>t.true(callStack.length===3))
150-
},40)
160+
},0)
151161
})
152162

153163
test("test action",asynct=>{
@@ -167,8 +177,14 @@ test("test action", async t => {
167177
}
168178

169179
constaction=newCustomAction()
180+
letonce=false
170181

171182
dobEvent.on("debug",debugInfo=>{
183+
if(!once){
184+
return
185+
}
186+
once=false
187+
172188
deletedebugInfo.id
173189
t.deepEqual(debugInfo,{
174190
name:"CustomAction.action1",
@@ -200,16 +216,23 @@ test("test action", async t => {
200216
stopDebug()
201217

202218
returnimmediate(()=>t.true(true))
203-
},60)
219+
},0)
204220
})
205221

206222
test("test delete",asynct=>{
207223
returnimmediate(async()=>{
208224
startDebug()
209225

210226
constdynamicObj=observable({name:"b"})
227+
letonce=true
211228

212229
dobEvent.on("debug",debugInfo=>{
230+
if(!once){
231+
return
232+
}
233+
once=false
234+
235+
deletedebugInfo.id
213236
t.deepEqual(debugInfo,{
214237
name:null,
215238
changeList:[
@@ -228,5 +251,5 @@ test("test delete", async t => {
228251
deletedynamicObj.name
229252

230253
returnimmediate(()=>t.true(true))
231-
},80)
254+
},0)
232255
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp