Redwoodjs tests are broken

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

Yes, unfortunately. It’s been a long, uphill battle :cold_sweat: But good news is that there’s a lot happening real-time to support the Router in tests along with several other blocking issues. Progress happening here:

1 Like

@thedavid thanks for the pointer. I’ll follow that thread for updates.

1 Like