Closed robwatkin closed 8 years ago
What happens if you set the api.use for iron:router only for the client? Maybe noone has ever thought of making sure that tests actually work if iron:router is also included for the server?
api.use('iron:router', 'client');
Thanks for the idea @seeekr . I just tried it and still see the error
Rob
This fixes it for me:
api.use('iron:router@1.0.0');
My understanding is that when the test app is created, Meteor picks the latest patch of the earliest major.minor that satisfy the constraints. Without the @1.0.0, that means the latest patch of the earliest major.minor that claims to work with Meteor 1.1.0.2. So without the @1.0.0, I get:
$ grep iron:router /tmp/meteor-test-*/.meteor/versions
iron:router@0.9.1
With the @1.0.0, I get:
$ grep iron:router /tmp/meteor-test-*/.meteor/versions
iron:router@1.0.9
Strictly speaking, this appears to be bug in the iron:layout@0.3.0
package. I get the same error when using api.use('iron:layout
)' instead of api.use('iron:router')
, and adding @1.0.0
fixes it. When I don't specify a version, I get iron:layout@0.3.0
.
I don't know how the iron:layout
maintainers would best or most easily fix this. Do they need to publish a fixed iron:layout@0.3.1
? Do they actually need to fix the bug in the code, or, if the problem is caused by a change in one of its dependencies, can they just change the dependencies of iron:layout@0.3.1
so that it isn't compatible with whatever dependency versions are causing the problem?
I've hit a problem when using iron:router in a package with Tinytest. The issue has already been raised (next door) https://github.com/iron-meteor/iron-router/issues/1349. It can easily be replicated as follows:
Then add iron router into the package.js file
Running the tests gives the following in the browser console
I have tried mocking it with mocks.js
and package.js
but I still get the error.