You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be a very good video.
I installed the repo and npm test failed: Invariant failed: You should not use <Switch> outside a <Router>
Here's the steps:
➜ git clone https://github.com/harblaith7/React-Testing-Library-Net-Ninja.git
➜ React-Testing-Library-Net-Ninja git:(main) npm install
➜ React-Testing-Library-Net-Ninja git:(main) npm start
➜ React-Testing-Library-Net-Ninja git:(main) git checkout 01-Starter-Project
➜ React-Testing-Library-Net-Ninja git:(main) npm test
● renders learn react link
Invariant failed: You should not use <Switch> outside a <Router>
3 |
4 | test('renders learn react link', () => {
> 5 | render(<App />);
| ^
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
The text was updated successfully, but these errors were encountered:
This seems to be a very good video. I installed the repo and npm test failed: Invariant failed: You should not use <Switch> outside a <Router> Here's the steps: ➜ git clone https://github.com/harblaith7/React-Testing-Library-Net-Ninja.git ➜ React-Testing-Library-Net-Ninja git:(main) npm install ➜ React-Testing-Library-Net-Ninja git:(main) npm start ➜ React-Testing-Library-Net-Ninja git:(main) git checkout 01-Starter-Project ➜ React-Testing-Library-Net-Ninja git:(main) npm test
● renders learn react link
Invariant failed: You should not use <Switch> outside a <Router>
3 |
4 | test('renders learn react link', () => {
> 5 | render(<App />);
| ^
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
you can watch the solution of this error in video #8 - Assertions.
you should wrap your component around browser router.
This seems to be a very good video.
I installed the repo and
npm test
failed:Invariant failed: You should not use <Switch> outside a <Router>
Here's the steps:
➜ git clone https://github.com/harblaith7/React-Testing-Library-Net-Ninja.git
➜ React-Testing-Library-Net-Ninja git:(main) npm install
➜ React-Testing-Library-Net-Ninja git:(main) npm start
➜ React-Testing-Library-Net-Ninja git:(main) git checkout 01-Starter-Project
➜ React-Testing-Library-Net-Ninja git:(main) npm test
The text was updated successfully, but these errors were encountered: