Skip to content

Instantly share code, notes, and snippets.

@kinsteronline
Forked from deedubs/async.coffee
Created November 29, 2011 04:23
Show Gist options
  • Save kinsteronline/1403399 to your computer and use it in GitHub Desktop.
Save kinsteronline/1403399 to your computer and use it in GitHub Desktop.
Using coffeescript vowsjs for Async tests
vows = require 'vows'
assert = require 'assert'
cb = (callback) ->
setTimeout ->
callback(null, 'callback')
, 2000
andWaitForCallback = undefined
vows
.describe('Callback Example')
.addBatch
'base:':
topic: ->
cb @callback
andWaitForCallback
"should be callback": (err, result) ->
assert.equal result, 'callback'
.export module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment