claude-code-best/test-mock.ts
Onuzulike Anthony Ifechukwu eaeefafe5f Refactor tests and improve mocking for better isolation
- Updated test files to use `afterAll` for restoring mocks, ensuring cleaner test environments.
- Simplified platform mocking in `modifiers-napi` tests to avoid global state mutations.
- Enhanced `useFrustrationDetection` tests with clearer structure and consistent timeout settings.
- Consolidated React and Ink mocks into a dedicated `test-mock.ts` file for reuse across tests.
- Improved readability and maintainability of tests by standardizing timeout configurations.
- Adjusted imports and module mocks to prevent interference between test files.
2026-06-03 01:51:00 +01:00

10 lines
299 B
TypeScript

import { mock } from 'bun:test'
import * as React from 'react'
mock.module('@anthropic/ink', () => ({
Box: (p: any) => React.createElement('box', p),
Pane: (p: any) => React.createElement('pane', p),
Text: (p: any) => React.createElement('text', p),
useTheme: () => ['dark', () => {}],
}))