-
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
Simple Schema Returning null #8
Comments
Great catch - makes sense to me. Thanks for the PR! |
v1.0.2 has been published with your changes - thanks again! |
Hi, it("Should create a clean UserState object on signup", function(){
const userId = Meteor.call('user.signup', dummyUser.email, dummyUser.password)
const userState = UserState.findOne({userId})
assert.deepEqual(userState, UserState.schema.clean({userId}))
})
Is that an expected behaviour ? Since Thanks ! Edit : even if the test does not pass, my code works fine, the clean function is correctly triggered on insert |
Hi, this covers a usage case when using either the aldeed:collection2 or aldeed:simple-schema package. Although this doesn't usually affect functionality, when there is client-side code referencing a property on the schema, the schema is null, and therefore there is an error.
For example, for a given collection
Dogs
:Dogs.simpleSchema()._schema
would throwTypeError: Cannot read property '_schema' of null
. This doesn't happen outside of running tests. Would it be possible to include the schema in the collection stub? If I'm doing something wrong, please let me know. Thanks!The text was updated successfully, but these errors were encountered: