Closed cookiengineer closed 3 years ago
As of https://github.com/tholian-network/stealth/commit/ffff6d8b53d416068e316d41a93c7436e593edc2 this has been implemented. results.assert()
and timeline.time()
calls are now code-aligned, and represent the occurance index of the equivalent assert()
call inside the test
of the review
.
If a timeout
or interval
fires later in time, it will set the results and timeline values accordingly at the correct position.
Currently, the Results implementation assumes every
assert()
call to be called exactly once, and once only. This is wanted, but as of now can lead to side effects.As writing a Review for network protocols and network flows can fire events multiple times (by accident, while the implementation is still broken), there should be away to see what specific
assert()
call was called inside thedescribe()
block of the currently executed test.The
trace_assert()
method already can trace the specific assert call, but theResults
expect an incrementedthis.index < this.data.length
everywhere - which is kind of incorrect as a) the index can exceed the data.length in those scenarios and b) the index doesn't reflect the actual index of the assert call.In order to implement this, there are a couple of things necessary:
Results.from()
method that stores the expected order ofassert()
calls, including theirline number
- as that is the only way to map it viatrace_assert()
.Results.prototype.assert()
method to use a trace of the assert() call by default, and updatethis.stack[traced_index]
instead if usingthis.index++
.Results.prototype.complete()
method.Results.prototype.current()
method, as this won't work anymore.Renderer
logic that relies on thecurrent()
index to trigger a re-render of the screen output.