Skip to content

Commit c1ba073

Browse files
committed
test: add regression test for useProfiler warnings
1 parent 71e5199 commit c1ba073

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { renderHook } from '@testing-library/react-hooks';
2+
import useProfiler from '../hooks/useProfiler';
3+
4+
jest.useFakeTimers();
5+
console.warn = jest.fn();
6+
7+
describe('useProfiler', () => {
8+
it('should log no warnings', () => {
9+
const { result } = renderHook(useProfiler, {
10+
initialProps: { prop: 'TEST' }
11+
});
12+
result.current();
13+
expect(console.warn).not.toHaveBeenCalled();
14+
});
15+
});

0 commit comments

Comments
 (0)