From 59060d28f2cf74976ea2a7b1963e4d7befa6682c Mon Sep 17 00:00:00 2001 From: Yotam Mann Date: Thu, 29 Jun 2017 12:33:27 -0400 Subject: [PATCH] testing `cancel` --- test/event/Part.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/event/Part.js b/test/event/Part.js index 5e994f7a..25e53434 100644 --- a/test/event/Part.js +++ b/test/event/Part.js @@ -109,6 +109,26 @@ define(["helper/Basic", "Tone/event/Part", "Tone/core/Tone", }); }); + it("can cancel event changes", function(){ + var count = 0; + return Offline(function(Transport){ + var part = new Part(function(time){ + count++; + }, [{ + "time" : 0, + "note" : "C3" + }, + { + "time" : 0.2, + "note" : "D3" + }]).start(0).stop(0.1); + part.cancel(0.1); + Transport.start(0); + }, 0.3).then(function(){ + expect(count).to.equal(2); + }); + }); + it("can add an event as a time and value", function(){ return Offline(function(){ var part = new Part();