Skip to content

Commit

Permalink
tests: test consume.close() before producer.close() because the latte…
Browse files Browse the repository at this point in the history
…r also closes the consumer
  • Loading branch information
ibc committed Sep 20, 2023
1 parent acd1c95 commit 891613c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,14 @@ test('consumer.getStats() succeeds', async () =>
expect(typeof stats).toBe('object');
}, 20000);

test('consumer.close() succeed', () =>
{
audioConsumer.close();

expect(audioConsumer.closed).toBe(true);
expect(audioConsumer.track.readyState).toBe('ended');
});

test('producer.close() succeed', async () =>
{
audioProducer.close();
Expand Down Expand Up @@ -827,12 +835,11 @@ test('producer.close() succeed', async () =>
});
}, 20000);

test('consumer.close() succeed', () =>
test('dataConsumer.close() succeed', () =>
{
audioConsumer.close();
dataConsumer.close();

expect(audioConsumer.closed).toBe(true);
expect(audioConsumer.track.readyState).toBe('ended');
expect(dataConsumer.closed).toBe(true);
});

test('dataProducer.close() succeed', () =>
Expand All @@ -842,13 +849,6 @@ test('dataProducer.close() succeed', () =>
expect(dataProducer.closed).toBe(true);
});

test('dataConsumer.close() succeed', () =>
{
dataConsumer.close();

expect(dataConsumer.closed).toBe(true);
});

test('worker.close() succeeds', () =>
{
worker.close();
Expand Down

0 comments on commit 891613c

Please sign in to comment.