lettuce
Version:
Lettuce JS, Mini Mobile Framework for Romantic with DSL.
28 lines (23 loc) • 577 B
JavaScript
;
describe("Promise", function () {
var L;
beforeEach(function () {
L = new lettuce();
jasmine.clock().install();
});
it("should be use promise patterns", function () {
function late(n) {
var p = new L.Promise();
setTimeout(function() {
p.done(null, n);
}, n);
return p;
}
late(10).then(
function (err, n) {
expect(n).toEqual(10);
return late(n + 200);
}
).done();
});
});