react-hooks-testing-library
Version:
Simple component wrapper for testing React hooks
29 lines (19 loc) • 928 B
JavaScript
let deprecationMessage = `
react-hooks-testing-library has moved to @testing-library/react-hooks!
To upgrade, run:
npm uninstall react-hooks-testing-library
npm install --save-dev @testing-library/react-hooks
Remember to also update your import lines to the new package too:
\x1b[31m - import { renderHook, act } from 'react-hooks-testing-library'
\x1b[32m + import { renderHook, act } from '@testing-library/react-hooks'
Alternatively, you can continue to use an older version of react-hooks-testing-library.
More details on the move can be found here: https://github.com/testing-library/react-hooks-testing-library/issues/99
`.trim()
console.warn(deprecationMessage)
export * from '@testing-library/react-hooks'
export function testHook(...args) {
console.warn(
'`testHook` has been deprecated and will be removed in a future release. Please use `renderHook` instead.'
)
return renderHook(...args)
}