summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/test.defer.js21
1 files changed, 9 insertions, 12 deletions
diff --git a/test/test.defer.js b/test/test.defer.js
index 3a91c95..ef931c5 100644
--- a/test/test.defer.js
+++ b/test/test.defer.js
@@ -110,15 +110,12 @@ suite('defer', function(){
test('Should run the next frame even if frame before it errors', function(done) {
var fastdom = new FastDom();
- var frame = fastdom.frame;
+ var run = fastdom.run;
var error = sinon.stub().throws();
var callback = sinon.spy();
-
- sinon.stub(fastdom, 'frame', function() {
- try {
- frame.call(fastdom);
- } catch (e) {}
+ sinon.stub(fastdom, 'run', function() {
+ try { run.apply(fastdom, arguments); } catch (e) {}
});
fastdom.defer(error);
@@ -132,15 +129,15 @@ suite('defer', function(){
});
});
- test.only('Should continue to run future jobs when the last frame errors', function(done) {
+ test('Should continue to run future jobs when the last frame errors', function(done) {
var fastdom = new FastDom();
- var frame = fastdom.frame;
+ var run = fastdom.run;
var error = sinon.stub().throws();
var callback1 = sinon.spy();
var callback2 = sinon.spy();
- sinon.stub(fastdom, 'frame', function() {
- try { frame.call(fastdom); } catch (e) {}
+ sinon.stub(fastdom, 'run', function() {
+ try { run.apply(fastdom, arguments); } catch (e) {}
});
fastdom.defer(callback1);
@@ -148,7 +145,7 @@ suite('defer', function(){
setTimeout(function() {
fastdom.defer(callback2);
- }, 100);
+ }, 40);
raf(function() {
assert(callback1.called, 'the first job was run');
@@ -158,7 +155,7 @@ suite('defer', function(){
assert(callback2.called, 'the third job was run');
done();
});
- }, 100);
+ }, 40);
});
});
});