Remove done callback in tests (#3885)

This commit is contained in:
Gabe Kangas 2024-08-19 12:10:46 -07:00 committed by GitHub
parent b9e22e4d9c
commit 7c3d4d26df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,14 +51,12 @@ describe('fetch and parse HLS', () => {
var masterPlaylist; var masterPlaylist;
var mediaPlaylistUrl; var mediaPlaylistUrl;
test('fetch master playlist', async (done) => { test('fetch master playlist', async () => {
try { try {
masterPlaylist = await getPlaylist(masterPlaylistUrl); masterPlaylist = await getPlaylist(masterPlaylistUrl);
} catch (e) { } catch (e) {
console.error('error fetching and parsing master playlist', e); console.error('error fetching and parsing master playlist', e);
} }
done();
}); });
test('verify there is a media playlist', () => { test('verify there is a media playlist', () => {
@ -75,7 +73,7 @@ describe('fetch and parse HLS', () => {
} }
}); });
test('verify there are segments', async (done) => { test('verify there are segments', async () => {
let playlist; let playlist;
try { try {
playlist = await getPlaylist(mediaPlaylistUrl); playlist = await getPlaylist(mediaPlaylistUrl);
@ -85,8 +83,6 @@ describe('fetch and parse HLS', () => {
const segments = playlist.segments; const segments = playlist.segments;
expect(segments.length).toBeGreaterThan(0); expect(segments.length).toBeGreaterThan(0);
done();
}); });
// Iterate over segments and make sure they change. // Iterate over segments and make sure they change.
@ -94,7 +90,7 @@ describe('fetch and parse HLS', () => {
// fetch another just like a real HLS player would do. // fetch another just like a real HLS player would do.
var lastSegmentUrl; var lastSegmentUrl;
for (let i = 0; i < HLS_FETCH_ITERATIONS; i++) { for (let i = 0; i < HLS_FETCH_ITERATIONS; i++) {
test('fetch and monitor media playlist segments ' + i, async (done) => { test('fetch and monitor media playlist segments ' + i, async () => {
await new Promise((r) => setTimeout(r, 5000)); await new Promise((r) => setTimeout(r, 5000));
try { try {
@ -115,8 +111,6 @@ describe('fetch and parse HLS', () => {
} }
lastSegmentUrl = segment.uri; lastSegmentUrl = segment.uri;
done();
}); });
} }
}); });