Skip to content

Commit c93671a

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

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

tests/react/provider.test.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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'
66

7-
it('uses initial values from provider', async () => {
7+
it('uses initial values from provider', () => {
88
const countAtom = atom(1)
99
const petAtom = atom('cat')
1010

@@ -32,13 +32,11 @@ 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

41-
it('only uses initial value from provider for specific atom', async () => {
39+
it('only uses initial value from provider for specific atom', () => {
4240
const countAtom = atom(1)
4341
const petAtom = atom('cat')
4442

@@ -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)