I’m fixing the tests in my project and have two issues.
The first one is about routes not being initialized. The error is below. I’m able to reproduce the test failures in a simple redwoodblog example:
It looks like the tests need to initialize Router.
The second issue I have is how to run a single test. I tried the following. The parameters don’t seem to get passed to jest.
yarn rw test -i web/src/pages/AboutPage/AboutPage.test.js
Any suggestions on how to fix these 2 issues?
Error with router.
expect(received).not.toThrow()
Error name: "TypeError"
Error message: "_router.routes.home is not a function"
6 | <h1>AboutPage</h1>
7 | <p>Find me in ./web/src/pages/AboutPage/AboutPage.js</p>
> 8 | <p><Link to={routes.home()}>Home</Link></p>
| ^
9 | </div>
10 | )
11 | }