Skip to content

Commit

Permalink
Apply same change in the corresponding test in Node land
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Oct 19, 2023
1 parent 8e9b313 commit cf0b033
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions node/src/tests/test-WebRtcServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ test('router.createWebRtcTransport() with webRtcServer succeeds and transport is
const transport = await router.createWebRtcTransport(
{
webRtcServer,
appData : { foo: 'bar' }
// Let's disable UDP so resulting ICE candidates should only contain TCP.
enableUdp : false,
appData : { foo: 'bar' }
});

await expect(router.dump())
Expand All @@ -373,17 +375,12 @@ test('router.createWebRtcTransport() with webRtcServer succeeds and transport is

const iceCandidates = transport.iceCandidates;

expect(iceCandidates.length).toBe(2);
expect(iceCandidates.length).toBe(1);
expect(iceCandidates[0].ip).toBe('127.0.0.1');
expect(iceCandidates[0].port).toBe(port1);
expect(iceCandidates[0].protocol).toBe('udp');
expect(iceCandidates[0].port).toBe(port2);
expect(iceCandidates[0].protocol).toBe('tcp');
expect(iceCandidates[0].type).toBe('host');
expect(iceCandidates[0].tcpType).toBeUndefined();
expect(iceCandidates[1].ip).toBe('127.0.0.1');
expect(iceCandidates[1].port).toBe(port2);
expect(iceCandidates[1].protocol).toBe('tcp');
expect(iceCandidates[1].type).toBe('host');
expect(iceCandidates[1].tcpType).toBe('passive');
expect(iceCandidates[0].tcpType).toBe('passive');

expect(transport.iceState).toBe('new');
expect(transport.iceSelectedTuple).toBeUndefined();
Expand Down

0 comments on commit cf0b033

Please sign in to comment.