Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.6",
"@types/react": "^18.3.1",
"chalk": "^4.1.2",
"dotenv-cli": "^4.0.0",
"jest-diff": "^29.7.0",
"kcd-scripts": "^13.0.0",
"npm-run-all": "^4.1.5",
"react": "^18.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.0",
"rimraf": "^3.0.2",
"typescript": "^4.1.2"
Expand Down
9 changes: 5 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
prettyFormat,
Config as ConfigDTL,
} from '@testing-library/dom'
import {act as reactAct} from 'react-dom/test-utils'
import {act as reactDeprecatedAct} from 'react-dom/test-utils'
import {act as reactAct} from 'react'

export * from '@testing-library/dom'

Expand Down Expand Up @@ -245,10 +246,10 @@ export function renderHook<
export function cleanup(): void

/**
* Simply calls ReactDOMTestUtils.act(cb)
* Simply calls React.act(cb)
* If that's not available (older version of react) then it
* simply calls the given callback immediately
* simply calls the deprecated version which is ReactTestUtils.act(cb)
*/
export const act: typeof reactAct extends undefined
? (callback: () => void) => void
? typeof reactDeprecatedAct
: typeof reactAct