Skip to content

Commit

Permalink
transportType もテストするようにする
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Dec 8, 2024
1 parent d08e766 commit fec1a98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/sendonly/main.mts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ class SoraClient {
}
}

// E2E テスト用のコード
private onSignaling(event: SignalingEvent): void {
if (event.type === 'onmessage-switched') {
console.log('[signaling]', event.type)
console.log('[signaling]', event.type, event.transportType)
}
}
}
5 changes: 4 additions & 1 deletion tests/switched.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ test('sendonly type:switched pages', async ({ browser }) => {

// Console log の Promise が解決されるまで待機する
const msg = await consolePromise
// log [signaling] switched が出力されるので、args 0/1 をそれぞれチェックする
// log [signaling] switched websocket が出力されるので、args 0/1/2 をそれぞれチェックする
// [signaling]
const value1 = await msg.args()[0].jsonValue()
expect(value1).toBe('[signaling]')
// switched
const value2 = await msg.args()[1].jsonValue()
expect(value2).toBe('onmessage-switched')
// websocket
const value3 = await msg.args()[2].jsonValue()
expect(value3).toBe('websocket')

// 'Get Stats' ボタンをクリックして統計情報を取得
await sendonly.click('#get-stats')
Expand Down

0 comments on commit fec1a98

Please sign in to comment.