{:uriI"file:///Users/izik/www/sparse/izi_lightup/spec/javascripts/crit-utils/wait_for_spec.js?type=application/javascript&pipeline=self&id=ff6f268f456a9db2930c6591c30b26a0141c11dea2973a21f1649ef4e0e9a494:ET:load_pathI"8/Users/izik/www/sparse/izi_lightup/spec/javascripts;T: filenameI"T/Users/izik/www/sparse/izi_lightup/spec/javascripts/crit-utils/wait_for_spec.js;T: nameI"crit-utils/wait_for_spec;T:logical_pathI"%crit-utils/wait_for_spec.self.js;T:content_typeI"application/javascript;T: sourceI"describe("waitFor", function () { it("should exists as global function", function () { expect(waitFor).toBeDefined(); expect(typeof waitFor).toBe("function"); }); it("should return curried fn to pass callback", function () { expect(typeof waitFor("SOMEWHAT")).toBe("function"); }); it("should call callback", function () { return new Promise(function(resolve) { waitFor("jQuery")(function() { expect(jQuery).toBeDefined(); resolve(); }); }); }); it("should wait for required global variable", function () { jasmine.clock().install(); return new Promise(function(resolve) { var KEY = "some-awesome-key"; expect(window[KEY]).toBeUndefined(); jasmine.clock().tick(1000); setTimeout(function () { window[KEY] = "TODO"; }, 500); waitFor(KEY)(function () { expect(window[KEY]).toBeDefined(); resolve(); }); }); }); }); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"bfile-digest:///Users/izik/www/sparse/izi_lightup/spec/javascripts/crit-utils/wait_for_spec.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%xNts3 a+92'!OmLM: lengthi:dependencies_digest"% (FDϷH!kJ-|:idI"Eff6f268f456a9db2930c6591c30b26a0141c11dea2973a21f1649ef4e0e9a494;F: mtimel+W0]b