Refactor console error to be provider level, tracking error via boolean rather than full logs as state.

This commit is contained in:
Chad Curtis committed 2025-10-02 19:58:53 +00:00
1 parent 3fba26ddb7
commit 7574085213
10 files changed
+469 -93

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
import { describe, it, expect } from 'vitest';
import { renderHook } from '@testing-library/react';
import { useConsoleError } from './useConsoleError';
describe('useConsoleError', () => {
it('should throw error when used outside ConsoleErrorProvider', () => {
// Expect the hook to throw when not wrapped in provider
expect(() => {
renderHook(() => useConsoleError());
}).toThrow('useConsoleError must be used within a ConsoleErrorProvider');
});
});