From 6700a3c5f5e355efbbe9a7ca5c79bcf14cb8d793 Mon Sep 17 00:00:00 2001 From: Marcel Blum Date: Wed, 20 Oct 2021 22:30:59 -0400 Subject: [PATCH] fix failing tests to use same (corrected) currentTime as OneShotSource --- Tone/signal/ToneConstantSource.test.ts | 2 +- Tone/source/oscillator/ToneOscillatorNode.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tone/signal/ToneConstantSource.test.ts b/Tone/signal/ToneConstantSource.test.ts index 1ae9bea5..f8c7d868 100644 --- a/Tone/signal/ToneConstantSource.test.ts +++ b/Tone/signal/ToneConstantSource.test.ts @@ -152,7 +152,7 @@ describe("ToneConstantSource", () => { expect(source.getStateAtTime(0)).to.equal("stopped"); expect(source.getStateAtTime(currentTime)).to.equal("started"); setTimeout(() => { - currentTime = source.context.currentTime; + currentTime = source.now(); source.stop(0); expect(source.getStateAtTime(currentTime + 0.01)).to.equal("stopped"); source.dispose(); diff --git a/Tone/source/oscillator/ToneOscillatorNode.test.ts b/Tone/source/oscillator/ToneOscillatorNode.test.ts index 03c69533..79f27351 100644 --- a/Tone/source/oscillator/ToneOscillatorNode.test.ts +++ b/Tone/source/oscillator/ToneOscillatorNode.test.ts @@ -191,7 +191,7 @@ describe("ToneOscillatorNode", () => { expect(osc.getStateAtTime(0)).to.equal("stopped"); expect(osc.getStateAtTime(currentTime)).to.equal("started"); setTimeout(() => { - currentTime = osc.context.currentTime; + currentTime = osc.now(); osc.stop(0); expect(osc.getStateAtTime(currentTime + 0.01)).to.equal("stopped"); osc.dispose();