Tone.js/test/component/Limiter.js
tambien ed71d8141b amd to es6 import/export
no longer using AMD (require.js) style imports, and beginning to move to es6 "import/export" statements everywhere.
2019-01-27 13:05:20 -05:00

51 lines
1.3 KiB
JavaScript

import Limiter from "Tone/component/Limiter";
import Basic from "helper/Basic";
import PassAudio from "helper/PassAudio";
import PassAudioStereo from "helper/PassAudioStereo";
import Test from "helper/Test";
describe("Limiter", function(){
Basic(Limiter);
context("Limiting", function(){
it("handles input and output connections", function(){
var limiter = new Limiter();
Test.connect(limiter);
limiter.connect(Test);
limiter.dispose();
});
it("passes the incoming signal through", function(){
return PassAudio(function(input){
var limiter = new Limiter().toMaster();
input.connect(limiter);
});
});
it("passes the incoming stereo signal through", function(){
return PassAudioStereo(function(input){
var limiter = new Limiter().toMaster();
input.connect(limiter);
});
});
it("can be get and set through object", function(){
var limiter = new Limiter();
var values = {
"threshold" : -30,
};
limiter.set(values);
expect(limiter.get().threshold).to.be.closeTo(-30, 0.1);
limiter.dispose();
});
it("can set the threshold", function(){
var limiter = new Limiter();
limiter.threshold.value = -10;
expect(limiter.threshold.value).to.be.closeTo(-10, 0.1);
limiter.dispose();
});
});
});