From 02d461f7af5c32fec13eadf2379974c14a001e3d Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 25 Dec 2024 15:14:09 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=E6=A7=8B=E6=88=90=E3=82=92=E3=82=AC?= =?UTF-8?q?=E3=83=A9=E3=83=83=E3=81=A8=E5=A4=89=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.template | 10 +++++----- README.md | 10 ---------- {examples => e2e-tests}/README.md | 8 +++++--- {examples => e2e-tests}/check_stereo/index.html | 0 {examples => e2e-tests}/check_stereo/main.mts | 0 {examples => e2e-tests}/check_stereo_multi/index.html | 0 {examples => e2e-tests}/check_stereo_multi/main.mts | 0 .../data_channel_signaling_only/index.html | 0 .../data_channel_signaling_only/main.mts | 0 {examples => e2e-tests}/index.html | 0 {examples => e2e-tests}/messaging/index.html | 0 {examples => e2e-tests}/messaging/main.mts | 0 {examples => e2e-tests}/package.json | 0 {examples => e2e-tests}/recvonly/index.html | 0 {examples => e2e-tests}/recvonly/main.mts | 0 {examples => e2e-tests}/replace_track/index.html | 0 {examples => e2e-tests}/replace_track/main.mts | 0 {examples => e2e-tests}/sendonly/index.html | 0 {examples => e2e-tests}/sendonly/main.mts | 0 {examples => e2e-tests}/sendonly_audio/index.html | 0 {examples => e2e-tests}/sendonly_audio/main.mts | 0 {examples => e2e-tests}/sendrecv/index.html | 0 {examples => e2e-tests}/sendrecv/main.mts | 11 ++++++++++- {examples => e2e-tests}/simulcast/index.html | 0 {examples => e2e-tests}/simulcast/main.mts | 0 {examples => e2e-tests}/spotlight_recvonly/index.html | 0 {examples => e2e-tests}/spotlight_recvonly/main.mts | 0 {examples => e2e-tests}/spotlight_sendonly/index.html | 0 {examples => e2e-tests}/spotlight_sendonly/main.mts | 0 {examples => e2e-tests}/spotlight_sendrecv/index.html | 0 {examples => e2e-tests}/spotlight_sendrecv/main.mts | 0 {tests/playwright => e2e-tests/tests}/helper.ts | 0 .../tests}/message_header.spec.ts | 0 .../playwright => e2e-tests/tests}/messaging.spec.ts | 0 .../tests}/sendonly_audio.spec.ts | 0 .../tests}/sendonly_recvonly.spec.ts | 0 .../playwright => e2e-tests/tests}/sendrecv.spec.ts | 0 .../playwright => e2e-tests/tests}/simulcast.spec.ts | 0 .../tests}/spotlight_sendonly_recvonly.spec.ts | 0 .../tests}/spotlight_sendrecv.spec.ts | 0 .../playwright => e2e-tests/tests}/type_close.spec.ts | 0 .../tests}/type_switched.spec.ts | 0 .../playwright => e2e-tests/tests}/whip_whep.spec.ts | 0 {examples => e2e-tests}/tsconfig.json | 0 {examples => e2e-tests}/vite-env.d.ts | 0 {examples => e2e-tests}/vite.config.mjs | 2 ++ {examples => e2e-tests}/whep/index.html | 0 {examples => e2e-tests}/whep/main.mts | 0 {examples => e2e-tests}/whip/index.html | 0 {examples => e2e-tests}/whip/main.mts | 0 package.json | 2 +- playwright.config.mts | 2 +- pnpm-lock.yaml | 6 ------ tests/{vitest => }/utils.test.ts | 4 ++-- vitest.config.mjs | 2 +- 55 files changed, 27 insertions(+), 30 deletions(-) rename {examples => e2e-tests}/README.md (66%) rename {examples => e2e-tests}/check_stereo/index.html (100%) rename {examples => e2e-tests}/check_stereo/main.mts (100%) rename {examples => e2e-tests}/check_stereo_multi/index.html (100%) rename {examples => e2e-tests}/check_stereo_multi/main.mts (100%) rename {examples => e2e-tests}/data_channel_signaling_only/index.html (100%) rename {examples => e2e-tests}/data_channel_signaling_only/main.mts (100%) rename {examples => e2e-tests}/index.html (100%) rename {examples => e2e-tests}/messaging/index.html (100%) rename {examples => e2e-tests}/messaging/main.mts (100%) rename {examples => e2e-tests}/package.json (100%) rename {examples => e2e-tests}/recvonly/index.html (100%) rename {examples => e2e-tests}/recvonly/main.mts (100%) rename {examples => e2e-tests}/replace_track/index.html (100%) rename {examples => e2e-tests}/replace_track/main.mts (100%) rename {examples => e2e-tests}/sendonly/index.html (100%) rename {examples => e2e-tests}/sendonly/main.mts (100%) rename {examples => e2e-tests}/sendonly_audio/index.html (100%) rename {examples => e2e-tests}/sendonly_audio/main.mts (100%) rename {examples => e2e-tests}/sendrecv/index.html (100%) rename {examples => e2e-tests}/sendrecv/main.mts (95%) rename {examples => e2e-tests}/simulcast/index.html (100%) rename {examples => e2e-tests}/simulcast/main.mts (100%) rename {examples => e2e-tests}/spotlight_recvonly/index.html (100%) rename {examples => e2e-tests}/spotlight_recvonly/main.mts (100%) rename {examples => e2e-tests}/spotlight_sendonly/index.html (100%) rename {examples => e2e-tests}/spotlight_sendonly/main.mts (100%) rename {examples => e2e-tests}/spotlight_sendrecv/index.html (100%) rename {examples => e2e-tests}/spotlight_sendrecv/main.mts (100%) rename {tests/playwright => e2e-tests/tests}/helper.ts (100%) rename {tests/playwright => e2e-tests/tests}/message_header.spec.ts (100%) rename {tests/playwright => e2e-tests/tests}/messaging.spec.ts (100%) rename {tests/playwright => e2e-tests/tests}/sendonly_audio.spec.ts (100%) rename {tests/playwright => e2e-tests/tests}/sendonly_recvonly.spec.ts (100%) rename {tests/playwright => e2e-tests/tests}/sendrecv.spec.ts (100%) rename {tests/playwright => e2e-tests/tests}/simulcast.spec.ts (100%) rename {tests/playwright => e2e-tests/tests}/spotlight_sendonly_recvonly.spec.ts (100%) rename {tests/playwright => e2e-tests/tests}/spotlight_sendrecv.spec.ts (100%) rename {tests/playwright => e2e-tests/tests}/type_close.spec.ts (100%) rename {tests/playwright => e2e-tests/tests}/type_switched.spec.ts (100%) rename {tests/playwright => e2e-tests/tests}/whip_whep.spec.ts (100%) rename {examples => e2e-tests}/tsconfig.json (100%) rename {examples => e2e-tests}/vite-env.d.ts (100%) rename {examples => e2e-tests}/vite.config.mjs (94%) rename {examples => e2e-tests}/whep/index.html (100%) rename {examples => e2e-tests}/whep/main.mts (100%) rename {examples => e2e-tests}/whip/index.html (100%) rename {examples => e2e-tests}/whip/main.mts (100%) rename tests/{vitest => }/utils.test.ts (99%) diff --git a/.env.template b/.env.template index f6c6dff6..772ed632 100644 --- a/.env.template +++ b/.env.template @@ -1,14 +1,14 @@ # サンプルやテストに利用する Sora の Signaling URL を指定してください VITE_SORA_SIGNALING_URL=wss://sora.example.com/signaling -# サンプルやテストに利用する Sora の ChannelID のプレフィックスを指定してください -VITE_SORA_CHANNEL_ID_PREFIX=sora-js-sdk-examples__ +# サンプルやテストに利用する Sora の ChannelID を指定してください +VITE_SORA_CHANNEL_ID=sora-js-sdk # サンプルやテストに利用するアクセストークンを指定してください、不要であれば空欄で大丈夫です VITE_ACCESS_TOKEN=access_token # サンプルやテストに利用する Sora の API URL を指定ください、不要であれば空欄で大丈夫です VITE_SORA_API_URL=https://sora.example.com/api -# サンプルやテストに利用する Sora の WHIP のエンドポイント URL を指定してください +# サンプルやテストに利用する Sora の WHIP のエンドポイント URL を指定してください、不要であれば空欄で大丈夫です VITE_SORA_WHIP_ENDPOINT_URL=https://sora.example.com/whip -# サンプルやテストに利用する Sora の WHEP のエンドポイント URL を指定してください -VITE_SORA_WHEP_ENDPOINT_URL=https://sora.example.com/whep +# サンプルやテストに利用する Sora の WHEP のエンドポイント URL を指定してください、不要であれば空欄で大丈夫です +VITE_SORA_WHEP_ENDPOINT_URL=https://sora.example.com/whep \ No newline at end of file diff --git a/README.md b/README.md index bd5701a4..aefd3206 100644 --- a/README.md +++ b/README.md @@ -46,16 +46,6 @@ pnpm add sora-js-sdk > - Firefox 113 以降 > - Safari 16.4 以降 -## サンプル集 - -```bash -# .env.local を作成して適切な値を設定してください -$ cp .env.template .env.local -$ pnpm install -$ pnpm run build -$ pnpm run dev -``` - ## E2E (End to End) テスト Playwright を利用した E2E テストを実行できます。 diff --git a/examples/README.md b/e2e-tests/README.md similarity index 66% rename from examples/README.md rename to e2e-tests/README.md index 6b197bb9..a9739058 100644 --- a/examples/README.md +++ b/e2e-tests/README.md @@ -1,4 +1,4 @@ -# Sora JavaScript SDK サンプル +# Sora JavaScript SDK E2E テスト ## 使い方 @@ -9,12 +9,14 @@ $ cd sora-js-sdk $ cp .env.template .env.local $ pnpm install $ pnpm build -$ pnpm dev +$ pnpm e2e-test ``` ## WHIP/WHEP -SDK では対応していない WHIP/WHEP のサンプルを用意しています。 +SDK では対応していないブラウザレベルでの WHIP/WHEP の E2E テストを用意しています。 + +このサンプルは Chrome / Edge でのみ動作します。 WHIP/WHEP を利用するには whip/whep が有効になっており、 whip_turn/whep_turn も有効になっている必要があります。 diff --git a/examples/check_stereo/index.html b/e2e-tests/check_stereo/index.html similarity index 100% rename from examples/check_stereo/index.html rename to e2e-tests/check_stereo/index.html diff --git a/examples/check_stereo/main.mts b/e2e-tests/check_stereo/main.mts similarity index 100% rename from examples/check_stereo/main.mts rename to e2e-tests/check_stereo/main.mts diff --git a/examples/check_stereo_multi/index.html b/e2e-tests/check_stereo_multi/index.html similarity index 100% rename from examples/check_stereo_multi/index.html rename to e2e-tests/check_stereo_multi/index.html diff --git a/examples/check_stereo_multi/main.mts b/e2e-tests/check_stereo_multi/main.mts similarity index 100% rename from examples/check_stereo_multi/main.mts rename to e2e-tests/check_stereo_multi/main.mts diff --git a/examples/data_channel_signaling_only/index.html b/e2e-tests/data_channel_signaling_only/index.html similarity index 100% rename from examples/data_channel_signaling_only/index.html rename to e2e-tests/data_channel_signaling_only/index.html diff --git a/examples/data_channel_signaling_only/main.mts b/e2e-tests/data_channel_signaling_only/main.mts similarity index 100% rename from examples/data_channel_signaling_only/main.mts rename to e2e-tests/data_channel_signaling_only/main.mts diff --git a/examples/index.html b/e2e-tests/index.html similarity index 100% rename from examples/index.html rename to e2e-tests/index.html diff --git a/examples/messaging/index.html b/e2e-tests/messaging/index.html similarity index 100% rename from examples/messaging/index.html rename to e2e-tests/messaging/index.html diff --git a/examples/messaging/main.mts b/e2e-tests/messaging/main.mts similarity index 100% rename from examples/messaging/main.mts rename to e2e-tests/messaging/main.mts diff --git a/examples/package.json b/e2e-tests/package.json similarity index 100% rename from examples/package.json rename to e2e-tests/package.json diff --git a/examples/recvonly/index.html b/e2e-tests/recvonly/index.html similarity index 100% rename from examples/recvonly/index.html rename to e2e-tests/recvonly/index.html diff --git a/examples/recvonly/main.mts b/e2e-tests/recvonly/main.mts similarity index 100% rename from examples/recvonly/main.mts rename to e2e-tests/recvonly/main.mts diff --git a/examples/replace_track/index.html b/e2e-tests/replace_track/index.html similarity index 100% rename from examples/replace_track/index.html rename to e2e-tests/replace_track/index.html diff --git a/examples/replace_track/main.mts b/e2e-tests/replace_track/main.mts similarity index 100% rename from examples/replace_track/main.mts rename to e2e-tests/replace_track/main.mts diff --git a/examples/sendonly/index.html b/e2e-tests/sendonly/index.html similarity index 100% rename from examples/sendonly/index.html rename to e2e-tests/sendonly/index.html diff --git a/examples/sendonly/main.mts b/e2e-tests/sendonly/main.mts similarity index 100% rename from examples/sendonly/main.mts rename to e2e-tests/sendonly/main.mts diff --git a/examples/sendonly_audio/index.html b/e2e-tests/sendonly_audio/index.html similarity index 100% rename from examples/sendonly_audio/index.html rename to e2e-tests/sendonly_audio/index.html diff --git a/examples/sendonly_audio/main.mts b/e2e-tests/sendonly_audio/main.mts similarity index 100% rename from examples/sendonly_audio/main.mts rename to e2e-tests/sendonly_audio/main.mts diff --git a/examples/sendrecv/index.html b/e2e-tests/sendrecv/index.html similarity index 100% rename from examples/sendrecv/index.html rename to e2e-tests/sendrecv/index.html diff --git a/examples/sendrecv/main.mts b/e2e-tests/sendrecv/main.mts similarity index 95% rename from examples/sendrecv/main.mts rename to e2e-tests/sendrecv/main.mts index d5229bc6..3307464a 100644 --- a/examples/sendrecv/main.mts +++ b/e2e-tests/sendrecv/main.mts @@ -26,6 +26,7 @@ const getVideoCodecType = (): VideoCodecType | undefined => { document.addEventListener('DOMContentLoaded', async () => { const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL + const SORA_CHANNEL_ID = import.meta.env.VITE_SORA_CHANNEL_ID || '' const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || '' const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || '' const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || '' @@ -38,6 +39,7 @@ document.addEventListener('DOMContentLoaded', async () => { client = new SoraClient( SORA_SIGNALING_URL, + SORA_CHANNEL_ID, SORA_CHANNEL_ID_PREFIX, SORA_CHANNEL_ID_SUFFIX, ACCESS_TOKEN, @@ -90,6 +92,7 @@ class SoraClient { constructor( signalingUrl: string, + channelId: string, channelIdPrefix: string, channelIdSuffix: string, accessToken: string, @@ -97,7 +100,13 @@ class SoraClient { videoCodecType: VideoCodecType | undefined, ) { this.sora = Sora.connection(signalingUrl, this.debug) - this.channelId = `${channelIdPrefix}${channelName}${channelIdSuffix}` + + if (channelId === '') { + this.channelId = `${channelIdPrefix}${channelName}${channelIdSuffix}` + } else { + this.channelId = channelId + } + this.metadata = { access_token: accessToken } this.options = {} diff --git a/examples/simulcast/index.html b/e2e-tests/simulcast/index.html similarity index 100% rename from examples/simulcast/index.html rename to e2e-tests/simulcast/index.html diff --git a/examples/simulcast/main.mts b/e2e-tests/simulcast/main.mts similarity index 100% rename from examples/simulcast/main.mts rename to e2e-tests/simulcast/main.mts diff --git a/examples/spotlight_recvonly/index.html b/e2e-tests/spotlight_recvonly/index.html similarity index 100% rename from examples/spotlight_recvonly/index.html rename to e2e-tests/spotlight_recvonly/index.html diff --git a/examples/spotlight_recvonly/main.mts b/e2e-tests/spotlight_recvonly/main.mts similarity index 100% rename from examples/spotlight_recvonly/main.mts rename to e2e-tests/spotlight_recvonly/main.mts diff --git a/examples/spotlight_sendonly/index.html b/e2e-tests/spotlight_sendonly/index.html similarity index 100% rename from examples/spotlight_sendonly/index.html rename to e2e-tests/spotlight_sendonly/index.html diff --git a/examples/spotlight_sendonly/main.mts b/e2e-tests/spotlight_sendonly/main.mts similarity index 100% rename from examples/spotlight_sendonly/main.mts rename to e2e-tests/spotlight_sendonly/main.mts diff --git a/examples/spotlight_sendrecv/index.html b/e2e-tests/spotlight_sendrecv/index.html similarity index 100% rename from examples/spotlight_sendrecv/index.html rename to e2e-tests/spotlight_sendrecv/index.html diff --git a/examples/spotlight_sendrecv/main.mts b/e2e-tests/spotlight_sendrecv/main.mts similarity index 100% rename from examples/spotlight_sendrecv/main.mts rename to e2e-tests/spotlight_sendrecv/main.mts diff --git a/tests/playwright/helper.ts b/e2e-tests/tests/helper.ts similarity index 100% rename from tests/playwright/helper.ts rename to e2e-tests/tests/helper.ts diff --git a/tests/playwright/message_header.spec.ts b/e2e-tests/tests/message_header.spec.ts similarity index 100% rename from tests/playwright/message_header.spec.ts rename to e2e-tests/tests/message_header.spec.ts diff --git a/tests/playwright/messaging.spec.ts b/e2e-tests/tests/messaging.spec.ts similarity index 100% rename from tests/playwright/messaging.spec.ts rename to e2e-tests/tests/messaging.spec.ts diff --git a/tests/playwright/sendonly_audio.spec.ts b/e2e-tests/tests/sendonly_audio.spec.ts similarity index 100% rename from tests/playwright/sendonly_audio.spec.ts rename to e2e-tests/tests/sendonly_audio.spec.ts diff --git a/tests/playwright/sendonly_recvonly.spec.ts b/e2e-tests/tests/sendonly_recvonly.spec.ts similarity index 100% rename from tests/playwright/sendonly_recvonly.spec.ts rename to e2e-tests/tests/sendonly_recvonly.spec.ts diff --git a/tests/playwright/sendrecv.spec.ts b/e2e-tests/tests/sendrecv.spec.ts similarity index 100% rename from tests/playwright/sendrecv.spec.ts rename to e2e-tests/tests/sendrecv.spec.ts diff --git a/tests/playwright/simulcast.spec.ts b/e2e-tests/tests/simulcast.spec.ts similarity index 100% rename from tests/playwright/simulcast.spec.ts rename to e2e-tests/tests/simulcast.spec.ts diff --git a/tests/playwright/spotlight_sendonly_recvonly.spec.ts b/e2e-tests/tests/spotlight_sendonly_recvonly.spec.ts similarity index 100% rename from tests/playwright/spotlight_sendonly_recvonly.spec.ts rename to e2e-tests/tests/spotlight_sendonly_recvonly.spec.ts diff --git a/tests/playwright/spotlight_sendrecv.spec.ts b/e2e-tests/tests/spotlight_sendrecv.spec.ts similarity index 100% rename from tests/playwright/spotlight_sendrecv.spec.ts rename to e2e-tests/tests/spotlight_sendrecv.spec.ts diff --git a/tests/playwright/type_close.spec.ts b/e2e-tests/tests/type_close.spec.ts similarity index 100% rename from tests/playwright/type_close.spec.ts rename to e2e-tests/tests/type_close.spec.ts diff --git a/tests/playwright/type_switched.spec.ts b/e2e-tests/tests/type_switched.spec.ts similarity index 100% rename from tests/playwright/type_switched.spec.ts rename to e2e-tests/tests/type_switched.spec.ts diff --git a/tests/playwright/whip_whep.spec.ts b/e2e-tests/tests/whip_whep.spec.ts similarity index 100% rename from tests/playwright/whip_whep.spec.ts rename to e2e-tests/tests/whip_whep.spec.ts diff --git a/examples/tsconfig.json b/e2e-tests/tsconfig.json similarity index 100% rename from examples/tsconfig.json rename to e2e-tests/tsconfig.json diff --git a/examples/vite-env.d.ts b/e2e-tests/vite-env.d.ts similarity index 100% rename from examples/vite-env.d.ts rename to e2e-tests/vite-env.d.ts diff --git a/examples/vite.config.mjs b/e2e-tests/vite.config.mjs similarity index 94% rename from examples/vite.config.mjs rename to e2e-tests/vite.config.mjs index f75a31a8..6bb62123 100644 --- a/examples/vite.config.mjs +++ b/e2e-tests/vite.config.mjs @@ -32,6 +32,8 @@ export default defineConfig({ sendonly_audio: resolve(__dirname, 'sendonly_audio/index.html'), messaging: resolve(__dirname, 'messaging/index.html'), data_channel_signaling_only: resolve(__dirname, 'data_channel_signaling_only/index.html'), + whip: resolve(__dirname, 'whip/index.html'), + whep: resolve(__dirname, 'whep/index.html'), }, }, }, diff --git a/examples/whep/index.html b/e2e-tests/whep/index.html similarity index 100% rename from examples/whep/index.html rename to e2e-tests/whep/index.html diff --git a/examples/whep/main.mts b/e2e-tests/whep/main.mts similarity index 100% rename from examples/whep/main.mts rename to e2e-tests/whep/main.mts diff --git a/examples/whip/index.html b/e2e-tests/whip/index.html similarity index 100% rename from examples/whip/index.html rename to e2e-tests/whip/index.html diff --git a/examples/whip/main.mts b/e2e-tests/whip/main.mts similarity index 100% rename from examples/whip/main.mts rename to e2e-tests/whip/main.mts diff --git a/package.json b/package.json index 910a0cd0..a420611c 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "vite build", "watch": "vite build --watch", - "dev": "vite --config examples/vite.config.mjs", + "dev": "vite --config e2e-tests/vite.config.mjs", "e2e-test": "pnpm build && playwright test --project=chromium", "lint": "biome lint", "fmt": "biome format --write", diff --git a/playwright.config.mts b/playwright.config.mts index 228d90db..b748c960 100644 --- a/playwright.config.mts +++ b/playwright.config.mts @@ -3,7 +3,7 @@ import { defineConfig, devices } from '@playwright/test' // pnpm exec playwright test --ui export default defineConfig({ - testDir: 'tests/playwright', + testDir: 'e2e-tests/tests', // fullyParallel: true, reporter: 'html', use: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 52f97a50..46444810 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,12 +36,6 @@ importers: specifier: 2.1.8 version: 2.1.8(@types/node@22.8.4)(jsdom@25.0.1) - examples: - dependencies: - sora-js-sdk: - specifier: workspace:* - version: link:.. - packages: '@babel/helper-string-parser@7.25.9': diff --git a/tests/vitest/utils.test.ts b/tests/utils.test.ts similarity index 99% rename from tests/vitest/utils.test.ts rename to tests/utils.test.ts index 2806bd57..006bfab3 100644 --- a/tests/vitest/utils.test.ts +++ b/tests/utils.test.ts @@ -1,6 +1,6 @@ import { expect, test } from 'vitest' -import type { AudioCodecType, DataChannelDirection, VideoCodecType } from '../../src/types' -import { createSignalingMessage } from '../../src/utils' +import type { AudioCodecType, DataChannelDirection, VideoCodecType } from '../src/types' +import { createSignalingMessage } from '../src/utils' const channelId = '7N3fsMHob' const metadata = 'PG9A6RXgYqiqWKOVO' diff --git a/vitest.config.mjs b/vitest.config.mjs index d6c63303..e0624631 100644 --- a/vitest.config.mjs +++ b/vitest.config.mjs @@ -8,7 +8,7 @@ export default mergeConfig( defineConfig({ test: { environment: 'jsdom', - include: ['tests/vitest/**/*.ts'], + include: ['tests/**/*.ts'], }, }), ) From 6de2f2290efa9efd0833ba07ba67d20294deee3f Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 25 Dec 2024 15:18:23 +0900 Subject: [PATCH 2/4] =?UTF-8?q?e2e-tests=20=E4=BB=A5=E4=B8=8B=E3=81=AB?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/npm-pkg-e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm-pkg-e2e-test.yml b/.github/workflows/npm-pkg-e2e-test.yml index e20f4c28..37564990 100644 --- a/.github/workflows/npm-pkg-e2e-test.yml +++ b/.github/workflows/npm-pkg-e2e-test.yml @@ -57,7 +57,7 @@ jobs: - run: pnpm --version - run: pnpm install - run: pnpm add -E sora-js-sdk@${{ matrix.sdk_version }} - working-directory: ./examples + working-directory: ./e2e-tests # pnpm run build しない - run: pnpm exec playwright install ${{ matrix.browser }} --with-deps - run: pnpm exec playwright test --project=${{ matrix.browser }} From f6567bb29f4c76c57b86dd043693c53a216a2624 Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 25 Dec 2024 15:22:07 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index ba5624c4..1cc372d1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,8 @@ - @voluntas - [ADD] .markdownlint.yaml ファイルを追加する - @voluntas +- [CHANGE] examples を e2e-tests に変更する + - @voluntas - [CHANGE] tsconfig.json の moduleResolution を Bundler に変更する - @voluntas - [CHANGE] tsconfig.json の target と module を ES2022 に変更する From da4af90fab42926a3e33296d6f2789335bac4513 Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 25 Dec 2024 15:44:29 +0900 Subject: [PATCH 4/4] =?UTF-8?q?channel=5Fid=5Fprefix=20=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e-tests/sendrecv/main.mts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/e2e-tests/sendrecv/main.mts b/e2e-tests/sendrecv/main.mts index 3307464a..ca7f2c6d 100644 --- a/e2e-tests/sendrecv/main.mts +++ b/e2e-tests/sendrecv/main.mts @@ -26,7 +26,6 @@ const getVideoCodecType = (): VideoCodecType | undefined => { document.addEventListener('DOMContentLoaded', async () => { const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL - const SORA_CHANNEL_ID = import.meta.env.VITE_SORA_CHANNEL_ID || '' const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || '' const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || '' const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || '' @@ -39,7 +38,6 @@ document.addEventListener('DOMContentLoaded', async () => { client = new SoraClient( SORA_SIGNALING_URL, - SORA_CHANNEL_ID, SORA_CHANNEL_ID_PREFIX, SORA_CHANNEL_ID_SUFFIX, ACCESS_TOKEN, @@ -92,7 +90,6 @@ class SoraClient { constructor( signalingUrl: string, - channelId: string, channelIdPrefix: string, channelIdSuffix: string, accessToken: string, @@ -101,11 +98,7 @@ class SoraClient { ) { this.sora = Sora.connection(signalingUrl, this.debug) - if (channelId === '') { - this.channelId = `${channelIdPrefix}${channelName}${channelIdSuffix}` - } else { - this.channelId = channelId - } + this.channelId = `${channelIdPrefix}${channelName}${channelIdSuffix}` this.metadata = { access_token: accessToken } this.options = {}