fluentforward / data-driven

Data driven testing for mocha.js
MIT License
29 stars 15 forks source link

Promise support #14

Open antony opened 8 years ago

antony commented 8 years ago

A question, really.

We've started using promises for a lot of our tests in order to get a cleaner, more readable structure. We're using mocha-as-promised (previously just used co), which gives us tests which look like this:

it('some stuff', function * () {
  const value = yield someService.somePromise()
  expect(value).to.equal(5)
})

I can't seem to get data-driven to wrap this, as much as I'd like to. How difficult would it be (or is it already possible) to use data-driven along with generator functions?

Happy to do a PR if it's something that you think could be accomplished.

mjtodd commented 8 years ago

Hi. That's really interesting. I have used co before but not mocha-as-promised. From your sample it looks really nice.

I will take a look at trying it with data-driven and let you know.

Matt

On 4 Aug 2016, 18:05 +0100, Antony Jones notifications@github.com, wrote:

A question, really.

We've started using promises for a lot of our tests in order to get a cleaner, more readable structure. We're using mocha-as-promised (previously just used co), which gives us tests which look like this:

it('some stuff', function * () { const value = yield someService.somePromise() expect(value).to.equal(5) })

I can't seem to get data-driven to wrap this, as much as I'd like to. How difficult would it be (or is it already possible) to use data-driven along with generator functions?

Happy to do a PR if it's something that you think could be accomplished.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub (https://github.com/fluentsoftware/data-driven/issues/14), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAhqqaTK9JQQQY_vf5TwEfiZXQoUI9YVks5qchvSgaJpZM4Jc6cR).