Skip to content

Commit d75f1ad

Browse files
committed
move to modern timers
1 parent 7215206 commit d75f1ad

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

packages/@react-spectrum/actionbar/test/ActionBar.test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ describe('ActionBar', () => {
2323
beforeAll(() => {
2424
jest.spyOn(window.HTMLElement.prototype, 'clientWidth', 'get').mockImplementation(() => 1000);
2525
jest.spyOn(window.HTMLElement.prototype, 'clientHeight', 'get').mockImplementation(() => 500);
26-
jest.spyOn(window, 'requestAnimationFrame').mockImplementation(cb => setTimeout(cb, 0));
27-
jest.useFakeTimers('legacy');
26+
jest.useFakeTimers();
2827
});
2928

3029
afterEach(() => {

packages/@react-stately/data/test/useAsyncList.test.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function getItemsEnd() {
3737

3838
describe('useAsyncList', () => {
3939
beforeAll(() => {
40-
jest.useFakeTimers('legacy');
40+
jest.useFakeTimers();
4141
});
4242

4343
it('should call load function on init', async () => {
@@ -195,8 +195,7 @@ describe('useAsyncList', () => {
195195

196196
expect(result.current.loadingState).toBe('loading');
197197

198-
await act(async () => {
199-
});
198+
await act(async () => Promise.resolve());
200199

201200
expect(result.current.loadingState).toBe('error');
202201
expect(loadSpyThatThrows).toHaveBeenCalled();

0 commit comments

Comments
 (0)