-
Notifications
You must be signed in to change notification settings - Fork 17
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
Using stubbed collections for publication tests #14
Comments
Heads up - the closed issue in the johanbrook:meteor-publication-collector package where I mentioned this issue in did not resolve my problem. |
Hi @ebbe-brandstrup - thanks for reporting this. Any chance you could put together a small (runnable) repro showing the exact problem? I'll then use that repro to troubleshoot and fix the issue (I'm a bit swamped right now, so providing a runnable repro would definitely help get a fix for this in faster). Also - I love PR's if you're interested in addressing this issue yourself. Thanks again! |
I'll close this for now, but if you're able to supply a small, runnable reproduction that demonstrates this, I'll take a look. Thanks! |
Using a stub-collection with johanbrook:meteor-publication-collector sometimes causes the error > Error: Can't publish a cursor from a collection without a name. The simple fix for this is to create a localCollection with the same name as the real collection. To ensure the collection doesn't connect to the same database we pass `{ connection: null }` into the options, instead of a null name to the constructor.
Using a stub-collection with johanbrook:meteor-publication-collector sometimes causes the error > Error: Can't publish a cursor from a collection without a name. The simple fix for this is to create a localCollection with a name. To ensure that the stubbed collection doesn't connect to an existing local collection that was stubbed previously, we randomise the name.
I've just run into this issue as well. I was unable to make a simple reproduction, but was able to make a fix. I've added a PR with that fix in #27 |
Fix #14 - Using stubbed collections for publication tests
just realised that this is more likely to break tests that didn't have this issue before because the Working on a better solution that should also fix #24 |
Okay opened a new PR with the changes. Sorry for the mixup! |
No problem @coagmano - thanks for the fix. Published as |
Hi,
I'm trying to use the johanbrook:meteor-publication-collector package for publication tests. I would like to use stubbed collections to have the tests run quicker.
The stacktrace of the error I get is:
Can't publish a cursor from a collection without a name. at [object Object].LocalCollection.Cursor._publishCursor (packages/minimongo.js:265:11) at packages/johanbrook:publication-collector/publication-collector.js:49:20 at Array.map (native) at PublicationCollector.collect (packages/johanbrook:publication-collector/publication-collector.js:44:47)
It seems to me that the error occurs because this package creates an in-memory (minimongo) collection to replace the real collection by creating a new Meteor collection without a name (null).
I am hoping you have some insight to share?
Thanks!
The text was updated successfully, but these errors were encountered: