-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does mocha do asynchronous tests in browser? #217
Comments
it('should be async', function(done){
doSomethingAsync(function(){
assertSomething();
done();
});
}); |
// source code I don't want to chang it function setState(el) { setTimeout(function(){ el.addClass('active') }, 0) } -------------------------------------------------------------------------- // test code it('', function(){ var $el = $('document.body') setState($el) // how to test this without changing the source? // has something similar to qunit's stop method? assert($el.hasClass('active')) }) |
just setTimeout with 0 again and call done() in it, it'll fire after the other one |
not sure what stop() does in qunit, js has no sleep(), so i dont know what it would do |
Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: