mocha-given icon indicating copy to clipboard operation
mocha-given copied to clipboard

Promise support

Open TheLudd opened this issue 9 years ago • 12 comments

Mocha now has promise support. Would it be possible to also add it to mocha-given? In mocha i can write:

describe 'myPromiseFunction', ->

  beforeEach -> someAsyncSetup()

  it 'shoud return "foo" async', -> 
    myPromiseFunction().then (result) ->
      result.should.equal 'foo'  

It would be awesome if mocha-given supported this:

describe 'myPromiseFunction', ->

  Given -> someAsyncSetup()
  When -> myPromiseFunction().then (@result) =>
  Then -> @result == 'foo'

TheLudd avatar Aug 17 '14 08:08 TheLudd