From c49e43a5a6f4b602d07f72f76b8443bf37203a3f Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Wed, 6 Dec 2017 22:12:59 -0800 Subject: [PATCH] Sort child bundles by asset names to avoid race condition in tests --- test/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.js b/test/utils.js index f29605108ed..d1d45e9dcbe 100644 --- a/test/utils.js +++ b/test/utils.js @@ -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)); }