-
Notifications
You must be signed in to change notification settings - Fork 98
getUserData never hits 'User not found' #25
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
Comments
If you are calling it directly, how are you doing so? |
I'm well aware its a helper function 😄, I traced my problem to it('fails to resendVerifySignup on a non-existent user', () => {
return Promise.resolve()
.then(() => {
return app.service(options.path).create({
action: 'resendVerifySignup',
value: {
email: '[email protected]'
}
})
})
.then(() => {
throw new Error('There should be an error, not a result')
})
.catch((err) => {
expect(err.code).toBe(400)
expect(err.message).toBe('User not found.')
})
}) |
Not sure if I'm taking the docs too literally, but they also show total as a string: https://legacy.docs.feathersjs.com/databases/pagination.html {
"total": "<total number of records>",
"limit": "<max number of items per page>",
"skip": "<number of skipped items (offset)>",
"data": [/* data */]
} |
Yes, I think that's a bit too literal. I've never heard of It would be fortunate if you can reproduce this consistently. I also think this occurs outside this repo. I await your conclusions with baited breath. ;) |
It turns out the database adapter returns strings in count queries, so I'd say the problem doesn't lie in this module. Will file an issue over there. |
In
getUserData
, my app never hits the 'User not found' error. The reason is because, in my results, total is the string"0"
, not the integer0
. See https://github.com/feathersjs/feathers-authentication-management/blob/master/src/helpers.js#L66Is this something weird going on in my feather app or is this normal, and the code here should be updated to use an
==
or manually test both types?Sample result for empty users query:
The text was updated successfully, but these errors were encountered: