Tone.js/test/signal/Negate.js

38 lines
934 B
JavaScript
Raw Normal View History

2017-02-20 21:40:41 +00:00
define(["helper/ConstantOutput", "Tone/signal/Negate", "helper/Basic",
2015-08-24 15:17:21 +00:00
"Test", "Tone/source/Oscillator", "Tone/signal/Signal"],
2017-12-30 16:26:29 +00:00
function (ConstantOutput, Negate, Basic, Test, Oscillator, Signal) {
2015-08-24 15:17:21 +00:00
2015-08-24 21:29:19 +00:00
describe("Negate", function(){
2015-08-24 15:17:21 +00:00
2015-08-24 21:29:19 +00:00
Basic(Negate);
2015-08-24 15:17:21 +00:00
2015-08-24 21:29:19 +00:00
context("Negating", function(){
2015-08-24 15:17:21 +00:00
2015-08-24 21:29:19 +00:00
it("handles input and output connections", function(){
var negate = new Negate();
Test.connect(negate);
negate.connect(Test);
negate.dispose();
});
2017-02-20 21:40:41 +00:00
it("negateates a positive value", function(){
return ConstantOutput(function(){
var signal = new Signal(1);
var negate = new Negate();
2015-08-24 21:29:19 +00:00
signal.connect(negate);
2017-02-20 21:40:41 +00:00
negate.toMaster();
}, -1);
2015-08-24 21:29:19 +00:00
});
2017-02-20 21:40:41 +00:00
it("makes a negateative value positive", function(){
return ConstantOutput(function(){
var signal = new Signal(-10);
var negate = new Negate();
2015-08-24 21:29:19 +00:00
signal.connect(negate);
2017-02-20 21:40:41 +00:00
negate.toMaster();
}, 10);
2015-08-24 21:29:19 +00:00
});
2015-08-24 15:17:21 +00:00
});
});
2017-12-30 16:26:29 +00:00
});