Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { vi } from 'vitest';
- // mock MovieDB API calls
- const getMovieUtils = vi.mock('../../helpers/getMovieUtils', () => {
- const sampleMovieData = vi.importActual('./assets/searchData.json');
- const sampleMovieDetailsData = vi.importActual('./assets/movieData.json');
- return {
- default: {},
- getMoviesByName: vi.fn().mockResolvedValue(sampleMovieData),
- getMovieDetails: vi.fn().mockResolvedValue(sampleMovieDetailsData),
- };
- });
- export { getMovieUtils }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement