Created
November 25, 2015 23:10
-
-
Save kevinswiber/9d2c82b764b7c011355a to your computer and use it in GitHub Desktop.
Testing to see if function call works without a callback.
This file contains hidden or 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
var assert = require('assert'); | |
function maybeCallback(callback) { | |
setTimeout(function() { | |
callback(); | |
}, 5000); | |
}; | |
describe('maybeCallback', function() { | |
it('should execute without a callback function', function(done) { | |
this.timeout(10000); | |
var error = null; | |
try { | |
maybeCallback(); | |
} catch (ex) { | |
error = ex; | |
} | |
setTimeout(function() { | |
if (error) { | |
assert(false); | |
} | |
done(); | |
}, 5000); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment