Skip to content

Commit 0e7aa10

Browse files
committed
chore: fix test
1 parent 58a75d9 commit 0e7aa10

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/ace-editor/AceEditor-client.test.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ import {queryByText, render, waitForElementToBeRemoved} from '@testing-library/r
55
import {useAceEditor} from './AceEditorLazy'
66

77
describe('AceEditor - client', () => {
8+
beforeEach(() => {
9+
jest
10+
.spyOn(window, 'requestAnimationFrame')
11+
.mockImplementation((callback: FrameRequestCallback): number => {
12+
callback(0)
13+
return 0
14+
})
15+
})
16+
17+
afterEach(() => {
18+
;(window.requestAnimationFrame as any).mockRestore()
19+
})
20+
821
it('should render suspended ace editor', async () => {
922
const fallbackString = 'loading'
1023

0 commit comments

Comments
 (0)