Skip to content

Instantly share code, notes, and snippets.

@francescoagati
Created July 1, 2011 15:37
Show Gist options
  • Save francescoagati/1058798 to your computer and use it in GitHub Desktop.
Save francescoagati/1058798 to your computer and use it in GitHub Desktop.
test async.js map with jasmine
describe "async", ->
it "async not null", ->
expect(async).not.toBeNull()
it "respond to map", ->
expect(async.map).not.toBeNull()
it "[1,2,3] map (x) -> x + 1 eq [2,3,4]", ->
callback = jasmine.createSpy()
summer= (el,callback) -> callback null, el + 1
async.map([1,2,3],summer,callback)
waitsFor -> callback.callCount > 0
runs -> expect(callback.mostRecentCall.args[1]).toEqual([2,3,4])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment