From 3718e1fa15b6ad7feaacd0102cd943fd48cb1a7b Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 12 Dec 2016 13:16:44 -0800 Subject: [PATCH] [tests] Implement "wait" command with Map#render This ensures that a "wait" command will always fully flush pending update flags. This was not the case with the prior conditional map.loaded() logic. --- platform/node/test/suite_implementation.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/platform/node/test/suite_implementation.js b/platform/node/test/suite_implementation.js index 28c206834..05b8113af 100644 --- a/platform/node/test/suite_implementation.js +++ b/platform/node/test/suite_implementation.js @@ -61,14 +61,9 @@ module.exports = function (style, options, callback) { callback(); } else if (operation[0] === 'wait') { - var wait = function () { - if (map.loaded()) { - applyOperations(operations.slice(1), callback); - } else { - map.render(options, wait); - } - }; - wait(); + map.render(options, function () { + applyOperations(operations.slice(1), callback); + }); } else { // Ensure that the next `map.render(options)` does not overwrite this change.