Skip to content

Commit 358da25

Browse files
committed
test time to 30sec
1 parent c9b27b7 commit 358da25

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/jest-tests/polyfill.test.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { expect } from '@jest/globals';
22
import { RTCPeerConnection, RTCDataChannel } from '../../src/polyfill/index';
33

44
describe('polyfill', () => {
5+
// Default is 5000 ms but we need more
6+
jest.setTimeout(30000);
7+
58
test('generateCertificate should throw', async () => {
69
await expect(async () => {
710
await RTCPeerConnection.generateCertificate();
@@ -29,7 +32,7 @@ describe('polyfill', () => {
2932
peerIdentity: 'peer1',
3033
iceServers: [{ urls: ['stun:stun.l.google.com:19302'] }],
3134
});
32-
35+
3336
const peer2 = new RTCPeerConnection({
3437
peerIdentity: 'peer2',
3538
iceServers: [{ urls: ['stun:stun.l.google.com:19302'] }],
@@ -54,7 +57,7 @@ describe('polyfill', () => {
5457
const dv = new DataView(binaryData);
5558
return (dv.getInt8(0)==123 && dv.getFloat32(1)==Math.fround(123.456) && dv.getUint32(5)==987654321 && dv.getFloat64(9)==789.012);
5659
}
57-
60+
5861
// We will set the "binaryType" and then send/receive the "data" from the datachannel in each test, and then compare them.
5962
// For example, the first line will send a "Hello" string after setting binaryType to "arraybuffer".
6063
const testMessages = [
@@ -136,7 +139,7 @@ describe('polyfill', () => {
136139
// Send the test message
137140
dc1.send(current.data);
138141
}
139-
142+
140143
// Set Callbacks
141144
peer1.onconnectionstatechange = (): void => {
142145
p1ConnectionStateMock();
@@ -151,7 +154,7 @@ describe('polyfill', () => {
151154
p1IceCandidateMock();
152155
peer2.addIceCandidate(e.candidate);
153156
};
154-
157+
155158
// Set Callbacks
156159
peer2.onconnectionstatechange = (): void => {
157160
p2ConnectionStateMock();
@@ -185,15 +188,15 @@ describe('polyfill', () => {
185188
peer2.setRemoteDescription(desc);
186189
})
187190
//.catch((err) => console.error(err));
188-
191+
189192
peer2
190193
.createAnswer()
191194
.then((answerDesc) => {
192195
p2SDPMock();
193196
peer1.setRemoteDescription(answerDesc);
194197
})
195198
//.catch((err) => console.error('Couldn't create answer', err));
196-
199+
197200
dc1 = peer1.createDataChannel('test-p2p');
198201
dc1.onopen = (): void => {
199202
p1DCMock();

0 commit comments

Comments
 (0)