Noah-Huppert / NoahHuppert.com

Personal website.
https://noahh.io
0 stars 0 forks source link

Figure out how to make asynchronous tests #12

Closed Noah-Huppert closed 9 years ago

Noah-Huppert commented 9 years ago

Some tests require asynchronous actions(Like certain Promise tests). Jasmine supposedly supports this with done()?

Figure out how to use this.

Noah-Huppert commented 9 years ago

When defining a test with it() just put a done parameter in the callback. Then when the async task is done call done()

it("foos the bazz", function(done){
    setTimeout(function(){
        done();
    }, 1);
});