From d2e82bab51f77adf112fd051e81e439bbc3cca03 Mon Sep 17 00:00:00 2001 From: Yotam Mann Date: Mon, 5 Mar 2018 23:09:36 -0500 Subject: [PATCH] using online testing only where supported --- test/core/Clock.js | 50 +++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/test/core/Clock.js b/test/core/Clock.js index 9a339bb3..5cf4928f 100644 --- a/test/core/Clock.js +++ b/test/core/Clock.js @@ -1,5 +1,5 @@ define(["Test", "Tone/core/Clock", "helper/Offline", "helper/Supports", "Tone/core/Tone"], - function(Test, Clock, Offline, Supports, Tone) { + function(Test, Clock, Offline, Supports, Tone){ describe("Clock", function(){ @@ -19,23 +19,27 @@ define(["Test", "Tone/core/Clock", "helper/Offline", "helper/Supports", "Tone/co clock.dispose(); }); - it("invokes the callback when started", function(done){ - var clock = new Clock(function(){ - clock.dispose(); - done(); - }, 10).start(); - }); + if (Supports.ONLINE_TESTING){ - it("can be constructed with an options object", function(done){ - var clock = new Clock({ - "callback" : function(){ + it("invokes the callback when started", function(done){ + var clock = new Clock(function(){ clock.dispose(); done(); - }, - "frequency" : 8 - }).start(); - expect(clock.frequency.value).to.equal(8); - }); + }, 10).start(); + }); + + it("can be constructed with an options object", function(done){ + var clock = new Clock({ + "callback" : function(){ + clock.dispose(); + done(); + }, + "frequency" : 8 + }).start(); + expect(clock.frequency.value).to.equal(8); + }); + + } it("can get and set it's values with the set/get", function(){ var clock = new Clock(); @@ -120,15 +124,15 @@ define(["Test", "Tone/core/Clock", "helper/Offline", "helper/Supports", "Tone/co context("Scheduling", function(){ - it("passes a time to the callback", function(done){ - var clock = new Clock(function(time){ - expect(time).to.be.a.number; - clock.dispose(); - done(); - }, 10).start(); - }); - if (Supports.ONLINE_TESTING){ + + it("passes a time to the callback", function(done){ + var clock = new Clock(function(time){ + expect(time).to.be.a.number; + clock.dispose(); + done(); + }, 10).start(); + }); it("invokes the callback with a time great than now", function(done){ var clock = new Clock(function(time){