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

Validate method #110

Merged
merged 4 commits into from
Dec 19, 2017
Merged

Validate method #110

merged 4 commits into from
Dec 19, 2017

Conversation

jkav77
Copy link
Collaborator

@jkav77 jkav77 commented Oct 1, 2017

I exposed a validate method on the dynogels model to solve #24. So now you can use the model to validate an instance like below. I included some tests and documentation updates. My tests don't cover many permutations so let me know if there is something that doesn't validate through this method.

const Tweet = dynogels.define({
....
})
const tweet = new Tweet({.....})
Tweet.validate(tweet) // returns { error, value }

@coveralls
Copy link

coveralls commented Oct 1, 2017

Coverage Status

Coverage increased (+0.003%) to 98.659% when pulling 85eca70 on dangerginger:validate-method into 6b3f75c on clarkie:master.

@jkav77
Copy link
Collaborator Author

jkav77 commented Oct 2, 2017

Actually this does not work. I added a failing test and will look at it later.

Add validate method to Model objects

Update documentation
validate now correctly uses the item attributes
@coveralls
Copy link

coveralls commented Oct 2, 2017

Coverage Status

Coverage increased (+0.003%) to 98.659% when pulling fa09840 on dangerginger:validate-method into 6b3f75c on clarkie:master.

@jkav77
Copy link
Collaborator Author

jkav77 commented Oct 2, 2017

Ok I fixed the tests which were not properly passing an Item object to the validate method which caused false positives and negatives. Then I fixed the validation method and it seems to be working now. I think this solves #24 now.

@coveralls
Copy link

coveralls commented Oct 4, 2017

Coverage Status

Coverage increased (+0.003%) to 98.659% when pulling 9a95fbc on dangerginger:validate-method into 6b3f75c on clarkie:master.

@coveralls
Copy link

coveralls commented Oct 14, 2017

Coverage Status

Coverage increased (+0.007%) to 98.664% when pulling b989888 on dangerginger:validate-method into 6b3f75c on clarkie:master.

@jkav77 jkav77 merged commit 6dcc3b0 into clarkie:master Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants