From 47b92021e6d9564d56b664d3990cc3be642e54cd Mon Sep 17 00:00:00 2001 From: Stanislav A Date: Thu, 22 Dec 2022 20:40:17 +0300 Subject: [PATCH] tweak buggy test --- tests/scriptlets/prevent-xhr.test.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/scriptlets/prevent-xhr.test.js b/tests/scriptlets/prevent-xhr.test.js index 91dc1585e..18b149ed2 100644 --- a/tests/scriptlets/prevent-xhr.test.js +++ b/tests/scriptlets/prevent-xhr.test.js @@ -598,8 +598,7 @@ if (isSupported) { runScriptlet(name, MATCH_DATA); - const done1 = assert.async(); - const done2 = assert.async(); + const done = assert.async(2); const xhr1 = new XMLHttpRequest(); const xhr2 = new XMLHttpRequest(); @@ -611,7 +610,7 @@ if (isSupported) { assert.strictEqual(xhr1.readyState, 4, 'Response done'); assert.ok(xhr1.response, 'Response data exists'); assert.strictEqual(window.hit, undefined, 'hit should not fire'); - done1(); + done(); }; xhr2.onload = () => { @@ -619,7 +618,7 @@ if (isSupported) { assert.strictEqual(typeof xhr2.responseText, 'string', 'Response text mocked'); assert.strictEqual(window.hit, 'FIRED', 'hit function fired'); clearGlobalProps('hit'); - done2(); + done(); }; xhr1.send();