Skip to content

Commit

Permalink
test: add regression test for useProfiler warnings (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
TuurDutoit committed Jul 22, 2024
1 parent 71e5199 commit 44a9700
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { renderHook } from '@testing-library/react-hooks';
import useProfiler from '../hooks/useProfiler';

jest.useFakeTimers();
console.warn = jest.fn();

describe('useProfiler', () => {
it('should log no warnings', () => {
const { result } = renderHook(useProfiler, {
initialProps: { prop: 'TEST' }
});
result.current();
expect(console.warn).not.toHaveBeenCalled();
});
});

0 comments on commit 44a9700

Please sign in to comment.