Tone.js/test/effect/Distortion.js

29 lines
661 B
JavaScript
Raw Normal View History

2015-08-26 14:29:35 +00:00
define(["Tone/effect/Distortion", "helper/Basic", "helper/EffectTests"], function (Distortion, Basic, EffectTests) {
describe("Distortion", function(){
Basic(Distortion);
EffectTests(Distortion);
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 dist = new Distortion({
"distortion" : 0.2,
});
expect(dist.distortion).to.be.closeTo(0.2, 0.01);
dist.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 dist = new Distortion();
dist.set({
"oversample" : "4x",
});
expect(dist.get().oversample).to.equal("4x");
dist.dispose();
});
});
});
2017-12-30 16:26:29 +00:00
});