From ebb2d09d17ee56b8fd73dc2fd1623441f8570d97 Mon Sep 17 00:00:00 2001 From: Alex Barstow Date: Fri, 11 Mar 2022 12:24:50 -0500 Subject: [PATCH] fix: async audio only tests (#7673) --- test/unit/player.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/player.test.js b/test/unit/player.test.js index e368c550a..2e832695b 100644 --- a/test/unit/player.test.js +++ b/test/unit/player.test.js @@ -2809,11 +2809,13 @@ QUnit.test('playbackRates only accepts arrays of numbers', function(assert) { QUnit.test('audioOnlyMode can be set by option', function(assert) { assert.expect(4); + const done = assert.async(); const player = TestHelpers.makePlayer({audioOnlyMode: true}); player.one('audioonlymodechange', () => { assert.equal(player.audioOnlyMode(), true, 'asynchronously set via option'); assert.equal(player.hasClass('vjs-audio-only-mode'), true, 'class added asynchronously'); + done(); }); assert.equal(player.audioOnlyMode(), false, 'defaults to false'); @@ -2827,11 +2829,10 @@ QUnit.test('audioOnlyMode(true) returns Promise when promises are supported', fu if (window.Promise) { assert.ok(returnValTrue instanceof window.Promise, 'audioOnlyMode(true) returns Promise when supported'); } - - return returnValTrue; }); QUnit.test('audioOnlyMode(false) returns Promise when promises are supported', function(assert) { + const done = assert.async(); const player = TestHelpers.makePlayer({audioOnlyMode: true}); player.one('audioonlymodechange', () => { @@ -2839,9 +2840,8 @@ QUnit.test('audioOnlyMode(false) returns Promise when promises are supported', f if (window.Promise) { assert.ok(returnValFalse instanceof window.Promise, 'audioOnlyMode(false) returns Promise when supported'); + done(); } - - return returnValFalse; }); });