Tone.js/test/effect/Chorus.js

35 lines
851 B
JavaScript
Raw Normal View History

2015-08-26 14:29:35 +00:00
define(["Tone/effect/Chorus", "helper/Basic", "helper/EffectTests"], function (Chorus, Basic, EffectTests) {
describe("Chorus", function(){
Basic(Chorus);
EffectTests(Chorus);
context("API", function(){
2017-12-30 16:26:29 +00:00
it("can pass in options in the constructor", function(){
2015-08-26 14:29:35 +00:00
var chorus = new Chorus({
"frequency" : 2,
"delayTime" : 1,
"depth" : 0.4,
2015-12-07 01:53:36 +00:00
"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);
2015-12-07 01:53:36 +00:00
expect(chorus.spread).to.be.equal(90);
2015-08-26 14:29:35 +00:00
chorus.dispose();
});
2017-12-30 16:26:29 +00:00
it("can get/set the options", function(){
2015-08-26 14:29:35 +00:00
var chorus = new Chorus();
chorus.set({
"type" : "square",
});
expect(chorus.get().type).to.equal("square");
chorus.dispose();
});
});
});
2017-12-30 16:26:29 +00:00
});