diff --git a/Tone/core/util/IntervalTimeline.test.ts b/Tone/core/util/IntervalTimeline.test.ts index 53c13b3d..a5258307 100644 --- a/Tone/core/util/IntervalTimeline.test.ts +++ b/Tone/core/util/IntervalTimeline.test.ts @@ -153,8 +153,7 @@ describe("IntervalTimeline", () => { state: "C", time: 2, }); - // @ts-ignore - expect(sched.get(0.2).state).to.equal("A"); + expect(sched.get(0.2)?.state).to.equal("A"); sched.dispose(); }); @@ -165,8 +164,7 @@ describe("IntervalTimeline", () => { state: "A", time: 0, }); - // @ts-ignore - expect(sched.get(0.99).state).to.equal("A"); + expect(sched.get(0.99)?.state).to.equal("A"); expect(sched.get(1)).to.equal(null); sched.dispose(); }); @@ -201,8 +199,7 @@ describe("IntervalTimeline", () => { state: "C", time: 2, }); - // @ts-ignore - expect(sched.get(0.2).state).to.equal("B"); + expect(sched.get(0.2)?.state).to.equal("B"); sched.dispose(); }); @@ -228,10 +225,8 @@ describe("IntervalTimeline", () => { sched.add(ev2); sched.remove(ev0); sched.remove(ev1); - // @ts-ignore expect(sched.get(0.2)).to.not.equal(null); - // @ts-ignore - expect(sched.get(0.2).state).to.equal("C"); + expect(sched.get(0.2)?.state).to.equal("C"); sched.dispose(); }); diff --git a/Tone/core/util/StateTimeline.test.ts b/Tone/core/util/StateTimeline.test.ts index 817b8686..1ba5284c 100644 --- a/Tone/core/util/StateTimeline.test.ts +++ b/Tone/core/util/StateTimeline.test.ts @@ -58,20 +58,13 @@ describe("StateTimeline", () => { sched.setStateAtTime("started", 2); sched.setStateAtTime("stopped", 3); expect(sched.getLastState("stopped", 1)).to.exist; - // @ts-ignore - expect(sched.getLastState("stopped", 1).state).is.equal("stopped"); - // @ts-ignore + expect(sched.getLastState("stopped", 1)?.state).is.equal("stopped"); expect(sched.getLastState("stopped", 2)).to.exist; - // @ts-ignore - expect(sched.getLastState("stopped", 2).state).is.equal("stopped"); - // @ts-ignore - expect(sched.getLastState("stopped", 2).time).is.equal(1); - // @ts-ignore - expect(sched.getLastState("stopped", 0.9).time).to.equal(0); - // @ts-ignore - expect(sched.getLastState("stopped", 4).state).is.equal("stopped"); - // @ts-ignore - expect(sched.getLastState("stopped", 4).time).is.equal(3); + expect(sched.getLastState("stopped", 2)?.state).is.equal("stopped"); + expect(sched.getLastState("stopped", 2)?.time).is.equal(1); + expect(sched.getLastState("stopped", 0.9)?.time).to.equal(0); + expect(sched.getLastState("stopped", 4)?.state).is.equal("stopped"); + expect(sched.getLastState("stopped", 4)?.time).is.equal(3); sched.dispose(); }); @@ -81,22 +74,14 @@ describe("StateTimeline", () => { sched.setStateAtTime("stopped", 1); sched.setStateAtTime("started", 2); sched.setStateAtTime("stopped", 3); - // @ts-ignore expect(sched.getNextState("stopped", 1)).to.exist; - // @ts-ignore - expect(sched.getNextState("stopped", 1).state).is.equal("stopped"); - // @ts-ignore + expect(sched.getNextState("stopped", 1)?.state).is.equal("stopped"); expect(sched.getNextState("stopped", 2)).to.exist; - // @ts-ignore - expect(sched.getNextState("stopped", 2).state).is.equal("stopped"); - // @ts-ignore - expect(sched.getNextState("stopped", 2).time).is.equal(3); - // @ts-ignore + expect(sched.getNextState("stopped", 2)?.state).is.equal("stopped"); + expect(sched.getNextState("stopped", 2)?.time).is.equal(3); expect(sched.getNextState("stopped", 0.9)).to.exist; - // @ts-ignore - expect(sched.getNextState("stopped", 0.9).state).is.equal("stopped"); - // @ts-ignore - expect(sched.getNextState("stopped", 0.9).time).is.equal(1); + expect(sched.getNextState("stopped", 0.9)?.state).is.equal("stopped"); + expect(sched.getNextState("stopped", 0.9)?.time).is.equal(1); sched.dispose(); }); }); diff --git a/test/helper/ToneAudioBuffer.ts b/test/helper/ToneAudioBuffer.ts deleted file mode 100644 index 2febe2b8..00000000 --- a/test/helper/ToneAudioBuffer.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ToneAudioBuffer } from "../../Tone/core/context/ToneAudioBuffer.js"; - -// point to the relative path of the audio files -// @ts-ignore -// if (window.__karma__) { -// ToneAudioBuffer.baseUrl = "/base/test/"; -// } else { -// ToneAudioBuffer.baseUrl = "../test/"; -// }