Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add regression test for useProfiler warnings #664

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TuurDutoit
Copy link
Contributor

@TuurDutoit TuurDutoit commented Jul 22, 2024

Checks

Description

This adds a regression test for #665

import { renderHook } from '@testing-library/react-hooks';
import useProfiler from '../hooks/useProfiler';

jest.useFakeTimers();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior of jest.useFakeTimers() might change depending on the version of Jest and the config we're using here. Alternatively, I could change this to:

global.performance = {
  now: jest.fn().mockReturnValue(0)
}

@TuurDutoit TuurDutoit force-pushed the test/regression-use-profiler-warnings branch from c1ba073 to 44a9700 Compare July 22, 2024 08:37
@TuurDutoit TuurDutoit marked this pull request as ready for review July 22, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant