diff --git a/packages/livedata/livedata_tests.js b/packages/livedata/livedata_tests.js index 23317cc574..504fd5a561 100644 --- a/packages/livedata/livedata_tests.js +++ b/packages/livedata/livedata_tests.js @@ -216,7 +216,7 @@ testAsyncMulti("livedata - compound methods", [ var release = expect(); onQuiesce(function () { checkBalances(test, 90, 60); - Tinytest.defer(release); + Meteor.defer(release); }); }, function (test, expect) { @@ -233,7 +233,7 @@ testAsyncMulti("livedata - compound methods", [ var release = expect(); onQuiesce(function () { checkBalances(test, 90, 60); - Tinytest.defer(release); + Meteor.defer(release); }); } ]); diff --git a/packages/mongo-livedata/mongo_livedata_tests.js b/packages/mongo-livedata/mongo_livedata_tests.js index 8ac47d107d..e8937c8e32 100644 --- a/packages/mongo-livedata/mongo_livedata_tests.js +++ b/packages/mongo-livedata/mongo_livedata_tests.js @@ -287,7 +287,7 @@ Tinytest.addAsync("mongo-livedata - fuzz test", function(test, onComplete) { test.isTrue(max_counters[k] >= counters[k], k); }); - Tinytest.defer(doStep); + Meteor.defer(doStep); }; doStep(); diff --git a/packages/spark/spark_tests.js b/packages/spark/spark_tests.js index b28998157e..cfda4d5dc4 100644 --- a/packages/spark/spark_tests.js +++ b/packages/spark/spark_tests.js @@ -2530,7 +2530,7 @@ testAsyncMulti( killLater(iframeDiv); }); var checkLater = function(frameName, iframe, iframeDiv) { - Tinytest.setTimeout(function() { + Meteor.setTimeout(function() { check(iframe, iframeDiv); }, 500); // wait for frame to unload }; diff --git a/packages/test-helpers/async_multi.js b/packages/test-helpers/async_multi.js index 9d3f2f04ec..0bfbd4afe1 100644 --- a/packages/test-helpers/async_multi.js +++ b/packages/test-helpers/async_multi.js @@ -122,11 +122,11 @@ var testAsyncMulti = function (name, funcs) { onComplete(); else { var em = new ExpectationManager(test, function () { - Tinytest.clearTimeout(timer); + Meteor.clearTimeout(timer); runNext(); }); - var timer = Tinytest.setTimeout(function () { + var timer = Meteor.setTimeout(function () { if (em.cancel()) { test.fail({type: "timeout", message: "Async batch timed out"}); onComplete(); @@ -139,7 +139,7 @@ var testAsyncMulti = function (name, funcs) { } catch (exception) { if (em.cancel()) test.exception(exception); - Tinytest.clearTimeout(timer); + Meteor.clearTimeout(timer); // Because we called test.exception, we're not to call onComplete. return; } diff --git a/packages/tinytest/tinytest.js b/packages/tinytest/tinytest.js index fa188a9d80..6f3ceee531 100644 --- a/packages/tinytest/tinytest.js +++ b/packages/tinytest/tinytest.js @@ -248,7 +248,7 @@ _.extend(TestCase.prototype, { onException(e); }, stop_at_offset); - Tinytest.defer(function () { + Meteor.defer(function () { try { if (self.async) { self.func(results, function () { @@ -416,40 +416,7 @@ globals.Tinytest = { addAsync: function (name, func) { TestManager.addCase(new TestCase(name, func, true)); - }, - - // Tinytest has versions of setTimeout et al. that preserve the - // environment with write fence on the server. Unlike how - // Meteor.setTimeout etc. are currently implemented, we *DO* - // want to block method satisfaction. - - setTimeout: function (f, duration) { - return setTimeout(Meteor.bindEnvironment(f, function (e) { - Meteor._debug("Exception from setTimeout callback:", e.stack); - }), duration); - }, - - setInterval: function (f, duration) { - return setInterval(Meteor.bindEnvironment(f, function (e) { - Meteor._debug("Exception from setInterval callback:", e); - }), duration); - }, - - clearInterval: function(x) { - return clearInterval(x); - }, - - clearTimeout: function(x) { - return clearTimeout(x); - }, - - defer: function (f) { - // Older Firefox will pass an argument to the setTimeout callback - // function, indicating the "actual lateness." It's non-standard, - // so for defer, standardize on not having it. - globals.Tinytest.setTimeout(function () {f();}, 0); } - }; // Run every test, asynchronously. Runs the test in the current