-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Promisify User model #1493
Promisify User model #1493
Conversation
done(); | ||
}); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this test, User.login
throws "Unhandled rejection Error: login failed". And so, when executing the test it says "Cannot call method 'then' of undefined". Whereas, https://github.com/strongloop/loopback/pull/1493/files#diff-5d81af95449574544e7317f3eda2badeR259, correctly returns fn.promise
@bajtos - can you help me?
@PradnyaBaviskar It would seem that the loopback team intentionally limited the promisification to CRUD methods
But that doesn't mean we shouldn't get the other ones also promisified, thanks for opening this, +1 |
@@ -80,6 +80,9 @@ module.exports = function(User) { | |||
cb = options; | |||
options = undefined; | |||
} | |||
|
|||
cb = cb || app.createPromiseCallback(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the app
variable defined? Perhaps this is throwing an error that is later converted to the error message you are seeing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, are you relying on the fact that test/support.js
is setting up a global app
variable?
ebef568
to
6113eef
Compare
6113eef
to
dc987a5
Compare
Done with promisifying User model. @raymondfeng, can you please review? |
@slnode test please |
Landed, thank you for the contribution! |
FWIW, the Jenkins build is failing due to an issue that was fixed on master by 34eb0e1 |
Connect #418