webstreamr-github/src/source/FrenchCloud.test.ts
2025-06-13 22:37:50 +02:00

23 lines
801 B
TypeScript

import { FrenchCloud } from './FrenchCloud';
import { FetcherMock, ImdbId } from '../utils';
import { Context } from '../types';
const ctx: Context = { id: 'id', ip: '127.0.0.1', config: { fr: 'on' } };
describe('FrenchCloud', () => {
let handler: FrenchCloud;
beforeEach(() => {
handler = new FrenchCloud(new FetcherMock(`${__dirname}/__fixtures__/FrenchCloud`));
});
test('handles non-existent movies gracefully', async () => {
const streams = await handler.handle(ctx, 'movie', new ImdbId('tt12345678', undefined, undefined));
expect(streams).toHaveLength(0);
});
test('handle imdb the devil\'s bath', async () => {
const streams = await handler.handle(ctx, 'movie', new ImdbId('tt29141112', undefined, undefined));
expect(streams).toMatchSnapshot();
});
});