mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-11 22:51:26 +00:00
Fix TypeScript errors in test files
- Fixed vitest matcher usage: replaced toBeTypeOf with typeof + toBe - Fixed import statements for fs and path modules to use namespace imports - Resolves TypeScript compilation errors preventing push Part of fixing test setup issues for PR #227
This commit is contained in:
parent
19b6fa3624
commit
96a1fc0a49
2 changed files with 8 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// pnpm test src/app/api/events/backfill/__tests__/route.test.ts
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { NextRequest } from 'next/server';
|
||||
|
||||
import { authorizeApi } from '@/actions/auth';
|
||||
|
|
@ -296,8 +296,8 @@ describe('/api/events/backfill', () => {
|
|||
say: 'api_req_started',
|
||||
});
|
||||
|
||||
expect(textMessage?.timestamp).toBeTypeOf('number');
|
||||
expect(apiMessage?.timestamp).toBeTypeOf('number');
|
||||
expect(typeof textMessage?.timestamp).toBe('number');
|
||||
expect(typeof apiMessage?.timestamp).toBe('number');
|
||||
|
||||
const messageTypes = dbData.map((item) => item.say);
|
||||
expect(messageTypes).toContain('text');
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
import '@testing-library/jest-dom';
|
||||
|
||||
(global as any).ResizeObserver = vi.fn().mockImplementation(() => ({
|
||||
// Mock ResizeObserver
|
||||
globalThis.ResizeObserver = vi.fn().mockImplementation(() => ({
|
||||
observe: vi.fn(),
|
||||
unobserve: vi.fn(),
|
||||
disconnect: vi.fn(),
|
||||
}));
|
||||
|
||||
(global as any).IntersectionObserver = vi.fn().mockImplementation(() => ({
|
||||
// Mock IntersectionObserver
|
||||
globalThis.IntersectionObserver = vi.fn().mockImplementation(() => ({
|
||||
observe: vi.fn(),
|
||||
unobserve: vi.fn(),
|
||||
disconnect: vi.fn(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue