From bc9c41f0054d04dbfd04af35116adc141bb8595e Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Mon, 9 Jun 2025 20:23:03 +0000 Subject: [PATCH] test: remove usesless filter calls --- src/handler/CineHDPlus.test.ts | 8 ++++---- src/handler/Eurostreaming.test.ts | 2 +- src/handler/Frembed.test.ts | 4 ++-- src/handler/FrenchCloud.test.ts | 2 +- src/handler/KinoGer.test.ts | 10 +++++----- src/handler/MeineCloud.test.ts | 2 +- src/handler/MostraGuarda.test.ts | 2 +- src/handler/Soaper.test.ts | 10 +++++----- src/handler/StreamKiste.test.ts | 2 +- src/handler/VerHdLink.test.ts | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/handler/CineHDPlus.test.ts b/src/handler/CineHDPlus.test.ts index ac0a762..08e00a1 100644 --- a/src/handler/CineHDPlus.test.ts +++ b/src/handler/CineHDPlus.test.ts @@ -23,20 +23,20 @@ describe('CineHDPlus', () => { }); test('handle imdb black mirror s2e3 (mx)', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt2085059', 2, 3))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt2085059', 2, 3)); expect(streams).toMatchSnapshot(); }); test('handle imdb babylon 5 s2e3 (es)', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt0105946', 2, 3))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt0105946', 2, 3)); expect(streams).toMatchSnapshot(); }); test('does not return mx results for es and vice-versa', async () => { - const streamsEs = (await handler.handle({ ...ctx, ...{ config: { es: 'on' } } }, 'series', new ImdbId('tt2085059', 2, 3))).filter(stream => stream !== undefined); + const streamsEs = await handler.handle({ ...ctx, ...{ config: { es: 'on' } } }, 'series', new ImdbId('tt2085059', 2, 3)); expect(streamsEs).toHaveLength(0); - const streamsMx = (await handler.handle({ ...ctx, ...{ config: { mx: 'on' } } }, 'series', new ImdbId('tt0105946', 2, 3))).filter(stream => stream !== undefined); + const streamsMx = await handler.handle({ ...ctx, ...{ config: { mx: 'on' } } }, 'series', new ImdbId('tt0105946', 2, 3)); expect(streamsMx).toHaveLength(0); }); }); diff --git a/src/handler/Eurostreaming.test.ts b/src/handler/Eurostreaming.test.ts index 7eeb0e0..269bde5 100644 --- a/src/handler/Eurostreaming.test.ts +++ b/src/handler/Eurostreaming.test.ts @@ -23,7 +23,7 @@ describe('Eurostreaming', () => { }); test('handle imdb black mirror s2e4', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt2085059', 2, 4))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt2085059', 2, 4)); expect(streams).toMatchSnapshot(); }); }); diff --git a/src/handler/Frembed.test.ts b/src/handler/Frembed.test.ts index 6075484..9ef796a 100644 --- a/src/handler/Frembed.test.ts +++ b/src/handler/Frembed.test.ts @@ -18,12 +18,12 @@ describe('Frembed', () => { }); test('handle imdb black mirror s4e2', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt2085059', 4, 2))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt2085059', 4, 2)); expect(streams).toMatchSnapshot(); }); test('handle tmdb black mirror s4e2', async () => { - const streams = (await handler.handle(ctx, 'series', new TmdbId(42009, 4, 2))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new TmdbId(42009, 4, 2)); expect(streams).toMatchSnapshot(); }); }); diff --git a/src/handler/FrenchCloud.test.ts b/src/handler/FrenchCloud.test.ts index b01e26d..3bfa5a3 100644 --- a/src/handler/FrenchCloud.test.ts +++ b/src/handler/FrenchCloud.test.ts @@ -23,7 +23,7 @@ describe('FrenchCloud', () => { }); test('handle imdb the devil\'s bath', async () => { - const streams = (await handler.handle(ctx, 'movie', new ImdbId('tt29141112', undefined, undefined))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'movie', new ImdbId('tt29141112', undefined, undefined)); expect(streams).toMatchSnapshot(); }); }); diff --git a/src/handler/KinoGer.test.ts b/src/handler/KinoGer.test.ts index 7a55c53..f8c1056 100644 --- a/src/handler/KinoGer.test.ts +++ b/src/handler/KinoGer.test.ts @@ -23,27 +23,27 @@ describe('KinoGer', () => { }); test('handle non-existent episode gracefully', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt2085059', 99, 99))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt2085059', 99, 99)); expect(streams).toHaveLength(0); }); test('handle imdb dead city s2e6', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt18546730', 2, 6))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt18546730', 2, 6)); expect(streams).toMatchSnapshot(); }); test('handle missing episode imdb black mirror s3e4', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt2085059', 3, 4))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt2085059', 3, 4)); expect(streams).toMatchSnapshot(); }); test('handle no fsst via brokeback mountain', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt0388795', undefined, undefined))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt0388795', undefined, undefined)); expect(streams).toMatchSnapshot(); }); test('handle imdb blood and sinners', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt31193180', undefined, undefined))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt31193180', undefined, undefined)); expect(streams).toMatchSnapshot(); }); }); diff --git a/src/handler/MeineCloud.test.ts b/src/handler/MeineCloud.test.ts index d23ca9a..a1d464d 100644 --- a/src/handler/MeineCloud.test.ts +++ b/src/handler/MeineCloud.test.ts @@ -23,7 +23,7 @@ describe('MeineCloud', () => { }); test('handle imdb the devil\'s bath', async () => { - const streams = (await handler.handle(ctx, 'movie', new ImdbId('tt29141112', undefined, undefined))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'movie', new ImdbId('tt29141112', undefined, undefined)); expect(streams).toMatchSnapshot(); }); }); diff --git a/src/handler/MostraGuarda.test.ts b/src/handler/MostraGuarda.test.ts index 57ac50c..9e9a5b0 100644 --- a/src/handler/MostraGuarda.test.ts +++ b/src/handler/MostraGuarda.test.ts @@ -23,7 +23,7 @@ describe('MostraGuarda', () => { }); test('handle imdb the devil\'s bath', async () => { - const streams = (await handler.handle(ctx, 'movie', new ImdbId('tt29141112', undefined, undefined))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'movie', new ImdbId('tt29141112', undefined, undefined)); expect(streams).toMatchSnapshot(); }); }); diff --git a/src/handler/Soaper.test.ts b/src/handler/Soaper.test.ts index c8a9d5e..bb2a153 100644 --- a/src/handler/Soaper.test.ts +++ b/src/handler/Soaper.test.ts @@ -23,27 +23,27 @@ describe('Soaper', () => { }); test('handle non-uploaded movie gracefully', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt29141112', undefined, undefined))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt29141112', undefined, undefined)); expect(streams).toHaveLength(0); }); test('handle non-existent episode gracefully', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt2085059', 99, 99))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt2085059', 99, 99)); expect(streams).toHaveLength(0); }); test('handle imdb black mirror s4e2', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt2085059', 4, 2))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt2085059', 4, 2)); expect(streams).toMatchSnapshot(); }); test('handle tmdb black mirror s4e2', async () => { - const streams = (await handler.handle(ctx, 'series', new TmdbId(42009, 4, 2))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new TmdbId(42009, 4, 2)); expect(streams).toMatchSnapshot(); }); test('handle imdb full metal jacket', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt0093058', undefined, undefined))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt0093058', undefined, undefined)); expect(streams).toMatchSnapshot(); }); }); diff --git a/src/handler/StreamKiste.test.ts b/src/handler/StreamKiste.test.ts index 60517ac..a10311f 100644 --- a/src/handler/StreamKiste.test.ts +++ b/src/handler/StreamKiste.test.ts @@ -23,7 +23,7 @@ describe('StreamKiste', () => { }); test('handle imdb black mirror s2e4', async () => { - const streams = (await handler.handle(ctx, 'series', new ImdbId('tt2085059', 2, 4))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'series', new ImdbId('tt2085059', 2, 4)); expect(streams).toMatchSnapshot(); }); }); diff --git a/src/handler/VerHdLink.test.ts b/src/handler/VerHdLink.test.ts index eb50871..c193d2a 100644 --- a/src/handler/VerHdLink.test.ts +++ b/src/handler/VerHdLink.test.ts @@ -23,7 +23,7 @@ describe('VerHdLink', () => { }); test('handle titanic', async () => { - const streams = (await handler.handle(ctx, 'movie', new ImdbId('tt0120338', undefined, undefined))).filter(stream => stream !== undefined); + const streams = await handler.handle(ctx, 'movie', new ImdbId('tt0120338', undefined, undefined)); expect(streams).toMatchSnapshot(); }); });