Log step sequence to keep track during tests. OFF BY ONE! OFF BY ONE!
This commit is contained in:
parent
11bf8b95f8
commit
19815dbb4d
|
@ -59,6 +59,7 @@ sequence.stop = function () {
|
||||||
|
|
||||||
if (sequence._state.stop) sequence._state.stop()
|
if (sequence._state.stop) sequence._state.stop()
|
||||||
if (sequence._state.input) sequence._state.input()
|
if (sequence._state.input) sequence._state.input()
|
||||||
|
|
||||||
sequence._state.stop = null
|
sequence._state.stop = null
|
||||||
sequence._state.input = null
|
sequence._state.input = null
|
||||||
}
|
}
|
||||||
|
@ -73,25 +74,26 @@ sequence.resume = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
sequence.step = function () {
|
sequence.step = function () {
|
||||||
|
log.info('step', `Started step ${sequence._state.count}`)
|
||||||
if (sequence._state.active && !sequence._state.paused) {
|
if (sequence._state.active && !sequence._state.paused) {
|
||||||
if (sequence._state.arr.length > 0) {
|
if (sequence._state.arr.length > 0) {
|
||||||
if (sequence._state.count > sequence._state.arr.length) {
|
if (sequence._state.count > sequence._state.arr.length - 1) {
|
||||||
return sequence.stop()
|
return sequence.stop()
|
||||||
}
|
}
|
||||||
log.info('step')
|
log.info('step', sequence._state.count)
|
||||||
return sequence._state.arr[sequence._state.count](() => {
|
return sequence._state.arr[sequence._state.count](() => {
|
||||||
sequence._state.count++
|
sequence._state.count++
|
||||||
sequence.step()
|
sequence.step()
|
||||||
})
|
})
|
||||||
} else if (sequence._loop.arr.length > 0) {
|
} else if (sequence._loop.arr.length > 0) {
|
||||||
if (sequence._state.count > sequence._loop.arr.length) {
|
if (sequence._state.count > sequence._loop.arr.length - 1) {
|
||||||
sequence._state.count = 0
|
sequence._state.count = 0
|
||||||
sequence._loop.count++
|
sequence._loop.count++
|
||||||
}
|
}
|
||||||
if (sequence._loop.max > 0 && sequence._loop.count > sequence._loop.max) {
|
if (sequence._loop.max > 0 && sequence._loop.count > sequence._loop.max) {
|
||||||
return sequence.stop()
|
return sequence.stop()
|
||||||
}
|
}
|
||||||
log.info()
|
log.info('step', sequence._state.count)
|
||||||
return sequence._loop.arr[sequence._state.count](() => {
|
return sequence._loop.arr[sequence._state.count](() => {
|
||||||
sequence._state.count++
|
sequence._state.count++
|
||||||
sequence.step()
|
sequence.step()
|
||||||
|
|
Loading…
Reference in New Issue