Skip to content

Commit 7e8d64e

Browse files
committed
fix: expose act from renderHook
1 parent 0f50982 commit 7e8d64e

File tree

6 files changed

+211
-430
lines changed

6 files changed

+211
-430
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ Other use cases are handled by CDP and `expect.element` which both have built-in
2727
```tsx
2828
import { renderHook } from 'vitest-browser-react'
2929
import { expect, test } from 'vitest'
30-
import { act } from 'react'
3130

3231
test('should increment counter', async () => {
33-
const { result } = renderHook(() => useCounter())
32+
const { result, act } = renderHook(() => useCounter())
3433

3534
act(() => {
3635
result.current.increment()

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"@types/react": "^18.0.0",
7373
"@types/react-dom": "^18.3.0",
7474
"@vitejs/plugin-react": "^4.3.3",
75-
"@vitest/browser": "^2.1.0",
75+
"@vitest/browser": "^3.1.0",
7676
"bumpp": "^9.4.2",
7777
"changelogithub": "^0.13.9",
7878
"eslint": "^9.8.0",
@@ -82,7 +82,7 @@
8282
"tsup": "^8.2.4",
8383
"tsx": "^4.17.0",
8484
"typescript": "^5.5.4",
85-
"vitest": "^2.1.0",
85+
"vitest": "^3.1.0",
8686
"zx": "^8.1.4"
8787
}
8888
}

0 commit comments

Comments
 (0)