Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Is there a way to test a function that returns a promise #4

Open
Tombert opened this Issue Jul 23, 2014 · 2 comments

Comments

Projects
None yet
2 participants

Tombert commented Jul 23, 2014

Hello! I'm a little new to the whole Node-unit-testing thing. I have some functions that return Bluebird promises, and am not entirely sure how to assert what they'll return. What would be the proper way of doing that?

Owner

mcandre commented Jul 23, 2014

That's a good question!

My first thought is to assert that the returned objects are "promise" objects, whatever that means in the type system (a function?). Would that be sufficient for your needs?

Tombert commented Jul 23, 2014

I need to check which arguments are going to be sent into the function in the .then callback of my promise, so I think asserting that they're promises would only solve half the issue.

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