We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit Testing react applications with routing should be easy.
main.tsx should render <Router><App/></Router> so that app.spec.tsx can render <MemoryRouter><App /><MemoryRouter>
main.tsx
<Router><App/></Router>
app.spec.tsx
<MemoryRouter><App /><MemoryRouter>
Unit Testing react applications with routing is not easy with the current setup.
<Router> is added within <App> which means that calling render(<MemoryRouter><App/></MemoryRouter>) does not work properly.
<Router>
<App>
render(<MemoryRouter><App/></MemoryRouter>)
Please provide detailed steps for reproducing the issue.
npx create-nx-workspace@latest react-test --preset empty
ng add @nrwl/react
The text was updated successfully, but these errors were encountered:
feat(react): Moves <BrowserRouter> to main.tsx for routing so the App…
1ed816b
… component can be tested. Close nrwl#1558
feat(react): move BrowserRouter to main.tsx for routing
064a33c
Close nrwl#1558
d592e25
a07f019
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Sorry, something went wrong.
jaysoo
No branches or pull requests
Expected Behavior
Unit Testing react applications with routing should be easy.
main.tsx
should render<Router><App/></Router>
so thatapp.spec.tsx
can render<MemoryRouter><App /><MemoryRouter>
Current Behavior
Unit Testing react applications with routing is not easy with the current setup.
<Router>
is added within<App>
which means that callingrender(<MemoryRouter><App/></MemoryRouter>)
does not work properly.Steps to Reproduce
Please provide detailed steps for reproducing the issue.
npx create-nx-workspace@latest react-test --preset empty
ng add @nrwl/react
The text was updated successfully, but these errors were encountered: