Created
November 30, 2021 09:22
-
-
Save codegino/a7fba3de24b4414c00ecf1090acaaf18 to your computer and use it in GitHub Desktop.
Testing Improvement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { render as rtlRender } from '@testing-library/react'; | |
import NdsThemeProvider from '../../Theme/NdsThemeProvider'; | |
function render(ui, {theme='blue', ...options} = {}) { | |
const Wrapper = ({children}) => ( | |
<NdsThemeProvider theme={theme}>{children}</NdsThemeProvider> | |
) | |
return rtlRender(ui, {wrapper: Wrapper, ...options}) | |
} | |
export * from '@testing-library/react'; | |
// override all test with our custom render function | |
export { render }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment