Fix ordering for suites with more than 11 direct children.
- When no specs were focused, they all had the same precedence, and `sort`ing them caused some of the nodes to move around Fixes #850
This commit is contained in:
@@ -132,30 +132,29 @@ getJasmineRequireObj().TreeProcessor = function() {
|
||||
}
|
||||
|
||||
function orderChildSegments(children) {
|
||||
var result = [];
|
||||
var specifiedOrder = [],
|
||||
unspecifiedOrder = [];
|
||||
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i],
|
||||
segments = stats[child.id].segments;
|
||||
|
||||
for (var j = 0; j < segments.length; j++) {
|
||||
result.push(segments[j]);
|
||||
var seg = segments[j];
|
||||
|
||||
if (seg.min === defaultMin) {
|
||||
unspecifiedOrder.push(seg);
|
||||
} else {
|
||||
specifiedOrder.push(seg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result.sort(function(a, b) {
|
||||
if (a.min === null) {
|
||||
return b.min === null ? 0 : 1;
|
||||
}
|
||||
|
||||
if (b.min === null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
specifiedOrder.sort(function(a, b) {
|
||||
return a.min - b.min;
|
||||
});
|
||||
|
||||
return result;
|
||||
return specifiedOrder.concat(unspecifiedOrder);
|
||||
}
|
||||
|
||||
function executeNode(node, segmentNumber) {
|
||||
|
||||
Reference in New Issue
Block a user