Skip to content

Commit

Permalink
Sort child bundles by asset names to avoid race condition in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Dec 7, 2017
1 parent e69c83d commit c49e43a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function assertBundleTree(bundle, tree) {
}

if (tree.childBundles) {
let children = Array.from(bundle.childBundles);//.sort((a, b) => a.name - b.name);
let children = Array.from(bundle.childBundles).sort((a, b) => Array.from(a.assets).sort()[0].basename < Array.from(b.assets).sort()[0].basename ? -1 : 1);
assert.equal(bundle.childBundles.size, tree.childBundles.length);
tree.childBundles.forEach((b, i) => assertBundleTree(children[i], b));
}
Expand Down

0 comments on commit c49e43a

Please sign in to comment.