Skip to content
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

when stubbing a collection with a schema defined, the insert "succeeds" but the record isn't created #25

Open
znewsham opened this issue Dec 4, 2017 · 5 comments

Comments

@znewsham
Copy link

znewsham commented Dec 4, 2017

As the title says, no error is thrown (sync or async) an _id is returned, but the record isn't actually created.

@znewsham
Copy link
Author

znewsham commented Dec 4, 2017

It seems that this is worse than I thought, I can't get any collection to stub correctly (on the server, not sure about client):

            import StubCollections from 'meteor/hwillson:stub-collections';
            var test = new Mongo.Collection("test");
            StubCollections.stub([test]);
            test.insert({test: "test"});
            console.log(test.findOne());//logs undefined

@spinualexandru
Copy link

+1

@hwillson
Copy link
Owner

@znewsham Any chance you could link to a small runnable reproduction that demonstrates this?

@znewsham
Copy link
Author

@hwillson I actually can't - I guess it has something to do with the other packages I'm using. I've tried adding the usual culprits (collections2, simple schema, hooks, etc) - but can't get this to repeat. I'm in the process of updating my meteor apps to 1.7, once I'm done doing that I'll confirm if this still exists.

@SimonSimCity
Copy link

SimonSimCity commented Jan 10, 2019

I had this when using another package which has lai:collection-extensions or another package, replacing the Mongo.Collection constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants