Skip to content

Commit 5ca02a8

Browse files
committed
FLUID-5936: use an asyncTest wrapper around the promise to prevent the all-tests runner from not handling these tests properly
1 parent 3f162b6 commit 5ca02a8

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

tests/component-tests/textToSpeech/js/TextToSpeechTests.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,31 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
171171
jqUnit.assertFalse("Shouldn't be paused", that.model.paused);
172172
};
173173

174-
fluid.tests.textToSpeech.issueTest = function (testFunc) {
175-
var runTests = fluid.textToSpeech.checkTTSSupport();
176-
runTests.then(function () {
177-
testFunc();
178-
}, fluid.tests.textToSpeech.bypassTest);
179-
};
180-
181174
fluid.tests.textToSpeech.bypassTest = function () {
182175
jqUnit.test("Tests were skipped - browser does not appear to support TTS", function () {
183176
jqUnit.assert("TESTS SKIPPED - browser does not support SpeechSynthesis");
184177
});
185178
};
186179

187-
fluid.tests.textToSpeech.issueTest(fluid.tests.textToSpeech.ttsTestEnvironment);
180+
var ttsStatus;
181+
182+
jqUnit.asyncTest("Confirming if TTS is available", function () {
183+
jqUnit.expect(1);
184+
var ttsSupport = fluid.textToSpeech.checkTTSSupport();
185+
ttsSupport.then(function (){
186+
ttsStatus = "TTS is available";
187+
fluid.tests.textToSpeech.ttsTestEnvironment();
188+
}, function () {
189+
ttsStatus = "TTS is unavailable";
190+
fluid.tests.textToSpeech.bypassTest();
191+
});
192+
193+
var ttsTest = function () {
194+
jqUnit.start();
195+
jqUnit.assert(ttsStatus);
196+
};
197+
198+
setTimeout(ttsTest, 1500);
188199

200+
});
189201
})();

0 commit comments

Comments
 (0)