kolodny / exercises

Some basic javascript coding challenges and interview questions
4.23k stars 672 forks source link

improve jasmine-async test #11

Closed domasx2 closed 3 years ago

domasx2 commented 9 years ago

Hi,

jasmine-async can now be passed with the following implementation:

module.exports = function (fn) {
    var test = fn();
    test.setup(test.test);
};

I think this was not the intended solution :) The test for this exercise does not reflect actual semantics of it() in jasmine - test case passed to it() is not executed immediately when it() is called. I modified the test to have it() store arguments and defer execution of test case function until after jasmineAsync returns. This way the implementation of this exercise is required to call it() to pass.