Closed flore77 closed 8 years ago
@jzaefferer what do you think so far?
Also if we will add helper functions like createSuiteStart
etc., we will simplify the code in the adapters, more exactly in JasmineAdatper and QunitAdapter.
Looks good! Can you update the spec as well?
Spec update also looks good!
I don't know what to do exactly with the errors
and assertions
arrays, there will be the same arrays also in the new created object, and slice
wouldn't work because there are objects, Assertions
objects. Would it be fine to leave them like they currently are ?
there will be the same arrays also in the new created object
Could you clarify this? I don't follow.
There will be no copies of those arrays, currently it will be the same array.
var errors = [];
var t = new Test():
t.errors = errors;
t.errors
will point to the same array, this can be changed through:
t.errors = errors.slice();
It will be another array, but sine in the array are objects, in the new created array will be the same objects and if some modifies t.errors
it will also reflect in the original errors
array.
And I am not sure how to handle this.
Okay, though I still don't understand the context where this is a problem. As long as TestStart
doesn't have assertions and errors, the array should exist on TestEnd
, right?
Yes, there exists only on TestEnd
. The problem would be if someone changes something, it would reflect also in our internal data structures. So the createTestEnd
function does not create a completely new object and I don't know if this is fine or no.
That seems fine to me.
Alright, then please review :smiley:
Finished changes.
Fixes #91.