Skip to content

npm test failing on initial install #10

@jkoren

Description

@jkoren

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 | });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions