actual
is being emptied after verifySteps(..)
is called
#1266
Labels
actual
is being emptied after verifySteps(..)
is called
#1266
Tell us about your runtime:
Node 9.3.0
The bug I'm experiencing is that the
actual
array for alog(..)
call from averifySteps(..)
is subsequently emptied out before the finaltestDone(..)
is called. That means I can't correctly output the test results forexpected
vsactual
wheneververifySteps(..)
fails.Here's some code to illustrate:
The console output looks like:
Notice how the first output has the
actual
array filled in, but the second output, from the same shared object but accessed from withintestDone(..)
, hasactual
as an empty array.I strongly suspect that what's happening is that when
verifySteps(..)
callslog(..)
, it passes a reference to its own internalstep(..)
queue asactual
, and then it empties that queue array at the end ofverifySteps(..)
. Instead, shouldn't a copy of that array be sent, so that when your internal queue is emptied, it doesn't affect my storage of the log details.I'm temporarily fixing this bug by doing
JSON.parse(JSON.stringify(details))
to JSON-clone the log details object so that I can't be affected by your internal queue reset. But I'd expect to just be able to store thedetails
object as-is and not have it later be modified at-a-distance unexpectedly by qunit.The text was updated successfully, but these errors were encountered: