11import { StrictMode } from 'react'
2- import { render , screen , waitFor } from '@testing-library/react'
2+ import { render , screen } from '@testing-library/react'
33import { expect , it } from 'vitest'
44import { Provider , useAtom } from 'jotai/react'
55import { 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
7470it ( 'renders correctly without children' , ( ) => {
0 commit comments