2015-08-26 14:29:35 +00:00
|
|
|
define(["Tone/effect/Phaser", "helper/Basic", "helper/EffectTests"], function (Phaser, Basic, EffectTests) {
|
|
|
|
|
|
|
|
describe("Phaser", function(){
|
|
|
|
|
|
|
|
Basic(Phaser);
|
|
|
|
EffectTests(Phaser);
|
|
|
|
|
|
|
|
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 phaser = new Phaser({
|
|
|
|
"frequency" : 0.2,
|
|
|
|
});
|
|
|
|
expect(phaser.frequency.value).to.be.closeTo(0.2, 0.01);
|
|
|
|
phaser.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 phaser = new Phaser();
|
|
|
|
phaser.set({
|
2015-12-07 06:04:09 +00:00
|
|
|
"octaves" : 0.21,
|
2015-08-26 14:29:35 +00:00
|
|
|
"baseFrequency" : 300,
|
|
|
|
});
|
|
|
|
expect(phaser.get().baseFrequency).to.be.closeTo(300, 0.01);
|
2015-12-07 06:04:09 +00:00
|
|
|
expect(phaser.get().octaves).to.be.closeTo(0.21, 0.01);
|
2015-08-26 14:29:35 +00:00
|
|
|
phaser.dispose();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2017-12-30 16:26:29 +00:00
|
|
|
});
|