New issue
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
How to unit test components with Link #39
Comments
workaround worked for me. |
Side note, the error is:
Seems like maybe "object" is the wrong thing here? |
"object" was the actual name of my route:
On Fri, Jun 20, 2014 at 1:43 PM, Ryan Florence notifications@github.com
|
Oh, well then, looks like we're doing it right 👯 |
This is actually what I've been doing in practice. Funny, I'm even using the filename |
Hi, isn't this aproach a bit heavy handed for unit-tests? Would it be possible to provide an API for registering dummy-routes? |
yes #70 particularly #70 (comment) |
Links throw errors if they can't find a route. When you're unit testing you probably don't have your routes configured.
Workaround (Solution?)
Have a file named
routes.js
that exports a router, but doesn't render:Then a main file that renders it
And then in your unit test, bring in the router, but don't render it. This should be enough to register all the routes so the links don't freak out.
Options for this lib
routes.js
file that doesn't render seems like the right thing to do, especially for integration tests, gives you control to render and teardown before each test.The text was updated successfully, but these errors were encountered: