Skip to content

Commit

Permalink
test: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raisedadead committed Jan 9, 2025
1 parent 1b4a60f commit cdbea02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/components/head.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { describe, it, expect, vi } from 'vitest';
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render } from '@testing-library/react';
import { MetaHead } from '../../components/head';

Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/pages/blog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Blog from '@/pages/blog';
import { SWRConfig } from 'swr';
import { fetchPostsList } from '@/lib/posts-fetcher';
import { MockedFunction } from 'vitest';
import { PostsResponse } from '@/lib/posts-fetcher'; // Add this import
import { ResponseData } from '@/lib/posts-fetcher';

// Mock the fetchPostsList function
vi.mock('@/lib/posts-fetcher', () => ({
Expand Down Expand Up @@ -52,7 +52,7 @@ describe('Blog', () => {

// Mock the fetchPostsList function to return the mockFallback data
(fetchPostsList as MockedFunction<typeof fetchPostsList>).mockResolvedValue(
mockFallback['/api/posts//'] as PostsResponse
mockFallback['/api/posts//'] as ResponseData
);
});

Expand Down

0 comments on commit cdbea02

Please sign in to comment.