Tone.js/test/effect/Chorus.js

44 lines
1,002 B
JavaScript
Raw Normal View History

import Chorus from "Tone/effect/Chorus";
import Basic from "helper/Basic";
import EffectTests from "helper/EffectTests";
2015-08-26 14:29:35 +00:00
describe("Chorus", function(){
2015-08-26 14:29:35 +00:00
Basic(Chorus);
EffectTests(Chorus);
2015-08-26 14:29:35 +00:00
context("API", function(){
it("can pass in options in the constructor", function(){
var chorus = new Chorus({
"frequency" : 2,
"delayTime" : 1,
"depth" : 0.4,
"spread" : 90
2015-08-26 14:29:35 +00:00
});
expect(chorus.frequency.value).to.be.closeTo(2, 0.01);
expect(chorus.delayTime).to.be.closeTo(1, 0.01);
expect(chorus.depth).to.be.closeTo(0.4, 0.01);
expect(chorus.spread).to.be.equal(90);
chorus.dispose();
});
2015-08-26 14:29:35 +00:00
it("can get/set the options", function(){
var chorus = new Chorus();
chorus.set({
"type" : "square",
2015-08-26 14:29:35 +00:00
});
expect(chorus.get().type).to.equal("square");
chorus.dispose();
2015-08-26 14:29:35 +00:00
});
2019-01-31 17:16:25 +00:00
it("can get/set the delayTime", function(){
var chorus = new Chorus();
chorus.delayTime = 3;
expect(chorus.delayTime).to.equal(3);
chorus.dispose();
});
2015-08-26 14:29:35 +00:00
});
2017-12-30 16:26:29 +00:00
});