From da82635c0abade1ae8776d9fd4ebb4796baccd59 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Sat, 9 Mar 2024 10:09:11 +0100 Subject: [PATCH 1/2] update test setup and bring back chai as a dependency using chai@3.5.0 which is an older version that still works with karma-chai --- .github/workflows/e2e-tests.yaml | 4 ++-- .github/workflows/lint-and-unit-tests.yml | 4 ++-- package.json | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index b2b129c4..4c3a483a 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -13,8 +13,8 @@ jobs: - browser: firefox version: nightly steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 - run: npm install - run: Xvfb :99 & - name: e2e-tests diff --git a/.github/workflows/lint-and-unit-tests.yml b/.github/workflows/lint-and-unit-tests.yml index f80c9178..df9671bb 100644 --- a/.github/workflows/lint-and-unit-tests.yml +++ b/.github/workflows/lint-and-unit-tests.yml @@ -6,7 +6,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 - run: npm install - run: npm run lint-and-unit-tests diff --git a/package.json b/package.json index 46ed5bc3..4110ed54 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@puppeteer/browsers": "^1.4.1", "babel-preset-env": "^1.7.0", "brfs": "^1.5.0", + "chai": "^3.5.0", "eslint-plugin-jest": "^27.4.0", "grunt": "^1.1.0", "grunt-babel": "^8.0.0", From 48dd89193b0f0a43859c514a528bba0d544187bc Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Sun, 24 Mar 2024 12:21:18 -0700 Subject: [PATCH 2/2] dont modify RTCSessionDescription.sdp --- test/e2e/maxMessageSize.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/e2e/maxMessageSize.js b/test/e2e/maxMessageSize.js index 60baa539..96d66b60 100644 --- a/test/e2e/maxMessageSize.js +++ b/test/e2e/maxMessageSize.js @@ -42,12 +42,13 @@ describe('maxMessageSize', () => { function patchMaxMessageSizeFactory(maxMessageSize) { return ((description) => { - description.sdp = description.sdp.replace( - /^a=max-message-size:\s*(\d+)\s*$/gm, ''); - description.sdp = description.sdp.replace( - /(^m=application\s+\d+\s+[\w/]*SCTP.*$)/m, - '$1\r\na=max-message-size:' + maxMessageSize); - return description; + return { + type: description.type, + sdp: description.sdp + .replace(/^a=max-message-size:\s*(\d+)\s*$/gm, '') + .replace(/(^m=application\s+\d+\s+[\w/]*SCTP.*$)/m, + '$1\r\na=max-message-size:' + maxMessageSize), + }; }); }