Skip to content

Commit

Permalink
test: do not run jest with --runInBand and decreate timeout of tests …
Browse files Browse the repository at this point in the history
…to 5s
  • Loading branch information
ibc committed Sep 15, 2023
1 parent 7c0930e commit 83ca494
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion npm-scripts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function test()
{
logInfo('test()');

executeCmd('jest --runInBand');
executeCmd('jest');
}

function installNodeDeps()
Expand Down
28 changes: 14 additions & 14 deletions src/tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test('create a Worker succeeds', async () =>

expect(typeof worker.pid).toBe('number');
expect(worker.closed).toBe(false);
}, 20000);
}, 5000);

test('worker.dump() succeeds with empty fields', async () =>
{
Expand All @@ -34,7 +34,7 @@ test('worker.dump() succeeds with empty fields', async () =>
players : [],
handlers : []
});
}, 20000);
}, 5000);

test('worker.getUserMedia() succeeds', async () =>
{
Expand Down Expand Up @@ -110,7 +110,7 @@ test('worker.getUserMedia() succeeds', async () =>
players : [],
handlers : []
});
}, 20000);
}, 5000);

test('create a Device with worker.createHandlerFactory() as argument succeeds', () =>
{
Expand All @@ -130,7 +130,7 @@ test('device.load() succeeds', async () =>
.toBe(undefined);

expect(device.loaded).toBe(true);
}, 20000);
}, 5000);

test('device.rtpCapabilities getter succeeds', () =>
{
Expand Down Expand Up @@ -418,7 +418,7 @@ test('transport.produce() succeeds', async () =>

sendTransport.removeAllListeners('connect');
sendTransport.removeAllListeners('produce');
}, 20000);
}, 5000);

test('transport.consume() succeeds', async () =>
{
Expand Down Expand Up @@ -573,7 +573,7 @@ test('transport.consume() succeeds', async () =>
expect(videoConsumer.appData).toEqual({});

recvTransport.removeAllListeners('connect');
}, 20000);
}, 5000);

test('transport.produceData() succeeds', async () =>
{
Expand Down Expand Up @@ -620,7 +620,7 @@ test('transport.produceData() succeeds', async () =>
expect(dataProducer.protocol).toBe('BAR');

sendTransport.removeAllListeners('producedata');
}, 20000);
}, 5000);

test('transport.consumeData() succeeds', async () =>
{
Expand All @@ -644,7 +644,7 @@ test('transport.consumeData() succeeds', async () =>
expect(typeof dataConsumer.sctpStreamParameters.streamId).toBe('number');
expect(dataConsumer.label).toBe('FOO');
expect(dataConsumer.protocol).toBe('BAR');
}, 20000);
}, 5000);

test('transport.produce() with a receiving track succeeds', async () =>
{
Expand All @@ -667,14 +667,14 @@ test('transport.produce() with a receiving track succeeds', async () =>
expect(secondAudioProducer.track).toBe(audioTrack);

sendTransport.removeAllListeners('produce');
}, 20000);
}, 5000);

test('transport.getStats() succeeds', async () =>
{
const stats = await sendTransport.getStats();

expect(typeof stats).toBe('object');
}, 20000);
}, 5000);

test('producer.replaceTrack() succeeds', async () =>
{
Expand Down Expand Up @@ -761,21 +761,21 @@ test('producer.replaceTrack() succeeds', async () =>
trackId : secondAudioProducer.track!.id
}
});
}, 20000);
}, 5000);

test('producer.getStats() succeeds', async () =>
{
const stats = await videoProducer.getStats();

expect(typeof stats).toBe('object');
}, 20000);
}, 5000);

test('consumer.getStats() succeeds', async () =>
{
const stats = await videoConsumer.getStats();

expect(typeof stats).toBe('object');
}, 20000);
}, 5000);

test('producer.close() succeed', async () =>
{
Expand Down Expand Up @@ -825,7 +825,7 @@ test('producer.close() succeed', async () =>
trackId : secondAudioProducer.track!.id
}
});
}, 20000);
}, 5000);

test('consumer.close() succeed', () =>
{
Expand Down

0 comments on commit 83ca494

Please sign in to comment.