Skip to content

Commit

Permalink
do not use optional chain operator for functional tests (#5246)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
tjenkinson authored Feb 20, 2023
1 parent 94e15a2 commit 01b2a69
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -376,31 +383,18 @@ 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
os: macOS 10.15
- 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
Expand Down
5 changes: 3 additions & 2 deletions tests/functional/auto/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/auto/testbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand Down

0 comments on commit 01b2a69

Please sign in to comment.