Created
July 1, 2011 15:37
-
-
Save francescoagati/1058798 to your computer and use it in GitHub Desktop.
test async.js map with jasmine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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