Skip to content

Commit 0fc2d0e

Browse files
committed
test(react/provider): remove 'waitFor'
1 parent 9c44611 commit 0fc2d0e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tests/react/provider.test.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { StrictMode } from 'react'
2-
import { render, screen, waitFor } from '@testing-library/react'
2+
import { render, screen } from '@testing-library/react'
33
import { expect, it } from 'vitest'
44
import { Provider, useAtom } from 'jotai/react'
55
import { atom, createStore } from 'jotai/vanilla'
@@ -32,10 +32,8 @@ it('uses initial values from provider', async () => {
3232
</StrictMode>,
3333
)
3434

35-
await waitFor(() => {
36-
expect(screen.getByText('count: 0')).toBeInTheDocument()
37-
expect(screen.getByText('pet: dog')).toBeInTheDocument()
38-
})
35+
expect(screen.getByText('count: 0')).toBeInTheDocument()
36+
expect(screen.getByText('pet: dog')).toBeInTheDocument()
3937
})
4038

4139
it('only uses initial value from provider for specific atom', async () => {
@@ -65,10 +63,8 @@ it('only uses initial value from provider for specific atom', async () => {
6563
</StrictMode>,
6664
)
6765

68-
await waitFor(() => {
69-
expect(screen.getByText('count: 1')).toBeInTheDocument()
70-
expect(screen.getByText('pet: dog')).toBeInTheDocument()
71-
})
66+
expect(screen.getByText('count: 1')).toBeInTheDocument()
67+
expect(screen.getByText('pet: dog')).toBeInTheDocument()
7268
})
7369

7470
it('renders correctly without children', () => {

0 commit comments

Comments
 (0)