2019-01-27 18:05:20 +00:00
|
|
|
import Phaser from "Tone/effect/Phaser";
|
|
|
|
import Basic from "helper/Basic";
|
|
|
|
import EffectTests from "helper/EffectTests";
|
2015-08-26 14:29:35 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
describe("Phaser", function(){
|
2015-08-26 14:29:35 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
Basic(Phaser);
|
|
|
|
EffectTests(Phaser);
|
2015-08-26 14:29:35 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
context("API", function(){
|
|
|
|
|
|
|
|
it("can pass in options in the constructor", function(){
|
|
|
|
var phaser = new Phaser({
|
|
|
|
"frequency" : 0.2,
|
2015-08-26 14:29:35 +00:00
|
|
|
});
|
2019-01-27 18:05:20 +00:00
|
|
|
expect(phaser.frequency.value).to.be.closeTo(0.2, 0.01);
|
|
|
|
phaser.dispose();
|
|
|
|
});
|
2015-08-26 14:29:35 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
it("can get/set the options", function(){
|
|
|
|
var phaser = new Phaser();
|
|
|
|
phaser.set({
|
|
|
|
"octaves" : 0.21,
|
|
|
|
"baseFrequency" : 300,
|
2015-08-26 14:29:35 +00:00
|
|
|
});
|
2019-01-27 18:05:20 +00:00
|
|
|
expect(phaser.get().baseFrequency).to.be.closeTo(300, 0.01);
|
|
|
|
expect(phaser.get().octaves).to.be.closeTo(0.21, 0.01);
|
|
|
|
phaser.dispose();
|
2015-08-26 14:29:35 +00:00
|
|
|
});
|
|
|
|
});
|
2017-12-30 16:26:29 +00:00
|
|
|
});
|
2019-01-27 18:05:20 +00:00
|
|
|
|