Small Nest.js-based project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

39 lines
1.4 KiB

import { describe, it, expect } from '@jest/globals';
import { createOmdbProvider } from '.';
describe('createOmdbProvider', () => {
const client = createOmdbProvider('68fd98ab');
it('returns correct data for tt10687116', async () => {
const result = await client.getMetadata('tt10687116');
expect(result).toMatchObject({
actors: ['Kid Cudi', 'Jessica Williams', 'Laura Harrier'],
awards: expect.any(String),
contentRating: 'TV-MA',
description: expect.any(String),
directors: ['Fletcher Moules'],
duration: 93,
dvdReleaseDate: '30 Sep 2022',
genres: ['Animation', 'Comedy', 'Music'],
imdbId: 'tt10687116',
posterUrl: expect.any(String),
productionCountries: ['United Kingdom', 'United States'],
productionYear: 2022,
ratings: expect.arrayContaining([
{
source: expect.any(String),
value: expect.any(String),
},
]),
releaseDate: '30 Sep 2022',
title: 'Entergalactic',
type: 'movie',
writers: ['Kid Cudi', 'Kenya Barris', 'Ian Edelman'],
});
}, 10_000);
it('returns undefined for non-existend movie id', async () => {
const result = await client.getMetadata('tt99999999999');
expect(result).toBeUndefined();
}, 10_000);
});