mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-29 04:53:10 +00:00
ed71d8141b
no longer using AMD (require.js) style imports, and beginning to move to es6 "import/export" statements everywhere.
40 lines
953 B
JavaScript
40 lines
953 B
JavaScript
import ConstantOutput from "helper/ConstantOutput";
|
|
import Negate from "Tone/signal/Negate";
|
|
import Basic from "helper/Basic";
|
|
import Test from "helper/Test";
|
|
import Oscillator from "Tone/source/Oscillator";
|
|
import Signal from "Tone/signal/Signal";
|
|
|
|
describe("Negate", function(){
|
|
|
|
Basic(Negate);
|
|
|
|
context("Negating", function(){
|
|
|
|
it("handles input and output connections", function(){
|
|
var negate = new Negate();
|
|
Test.connect(negate);
|
|
negate.connect(Test);
|
|
negate.dispose();
|
|
});
|
|
|
|
it("negateates a positive value", function(){
|
|
return ConstantOutput(function(){
|
|
var signal = new Signal(1);
|
|
var negate = new Negate();
|
|
signal.connect(negate);
|
|
negate.toMaster();
|
|
}, -1);
|
|
});
|
|
|
|
it("makes a negateative value positive", function(){
|
|
return ConstantOutput(function(){
|
|
var signal = new Signal(-10);
|
|
var negate = new Negate();
|
|
signal.connect(negate);
|
|
negate.toMaster();
|
|
}, 10);
|
|
});
|
|
});
|
|
});
|
|
|