From 01b2a69100e1c5eee028d243b2514d4513c2e83f Mon Sep 17 00:00:00 2001 From: Tom Jenkinson Date: Mon, 20 Feb 2023 20:33:28 +0000 Subject: [PATCH] do not use optional chain operator for functional tests (#5246) * do not use optional chain operator for functional tests because they need to be es5 * make both older chrome functional tests required * also do not use optional chain in testbench * set the step name to match what it was before --- .github/workflows/build.yml | 26 ++++++++++---------------- tests/functional/auto/setup.js | 5 +++-- tests/functional/auto/testbench.js | 2 +- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index afebb629038..d9d49020897 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -309,16 +309,23 @@ jobs: needs: [config, test_unit] if: needs.config.outputs.canUseSauce == 'true' runs-on: ubuntu-latest + name: test_functional_required (${{ matrix.config }}) strategy: fail-fast: true max-parallel: 8 matrix: - config: [chrome-win_10] - include: - config: chrome-win_10 ua: chrome os: Windows 10 + - config: chrome-osx_10.11-79.0 + ua: chrome + os: OS X 10.11 + uaVersion: '79.0' + - config: chrome-win_7-75.0 + ua: chrome + os: Windows 7 + uaVersion: '75.0' steps: - uses: actions/checkout@v3 @@ -376,16 +383,11 @@ jobs: needs: test_functional_required runs-on: ubuntu-latest continue-on-error: true + name: test_functional_optional (${{ matrix.config }}) strategy: fail-fast: false max-parallel: 8 matrix: - config: - - safari-macOS_10.15 - - firefox-win_10 - - chrome-osx_10.11-79.0 - - chrome-win_7-75.0 - include: - config: safari-macOS_10.15 ua: safari @@ -393,14 +395,6 @@ jobs: - config: firefox-win_10 ua: firefox os: Windows 10 - - config: chrome-osx_10.11-79.0 - ua: chrome - os: OS X 10.11 - uaVersion: '79.0' - - config: chrome-win_7-75.0 - ua: chrome - os: Windows 7 - uaVersion: '75.0' steps: - uses: actions/checkout@v3 diff --git a/tests/functional/auto/setup.js b/tests/functional/auto/setup.js index c662a88f100..cfaa4a386b2 100644 --- a/tests/functional/auto/setup.js +++ b/tests/functional/auto/setup.js @@ -596,7 +596,7 @@ describe(`testing hls.js playback in the browser on "${browserDescription}"`, fu after(async function () { if (useSauce && this.currentTest && this.currentTest.parent) { const tests = this.currentTest.parent.tests; - if (tests?.length && tests.every((test) => test.isPassed())) { + if (tests && tests.length && tests.every((test) => test.isPassed())) { browser.executeScript('sauce:job-result=passed'); } } @@ -621,7 +621,8 @@ describe(`testing hls.js playback in the browser on "${browserDescription}"`, fu const url = stream.url; const config = stream.config || {}; if ( - stream.skip_ua?.some((browserInfo) => { + stream.skip_ua && + stream.skip_ua.some((browserInfo) => { if (typeof browserInfo === 'string') { return browserInfo === browserConfig.name; } diff --git a/tests/functional/auto/testbench.js b/tests/functional/auto/testbench.js index 5b1571860ec..7cc540afc2b 100644 --- a/tests/functional/auto/testbench.js +++ b/tests/functional/auto/testbench.js @@ -72,7 +72,7 @@ function objectAssign(target) { ) { var nextKey = keysArray[nextIndex]; var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); - if (desc?.enumerable) { + if (desc && desc.enumerable) { to[nextKey] = nextSource[nextKey]; } }