Tone.js/Tone/signal/Negate.test.ts
Yotam Mann bfc3d7ed15 toMaster() -> toDestination()
more consistent with the Web Audio API
2019-07-25 11:32:56 -04:00

38 lines
954 B
TypeScript

import { BasicTests } from "test/helper/Basic";
import { connectFrom, connectTo } from "test/helper/Connect";
import { ConstantOutput } from "test/helper/ConstantOutput";
import { Negate } from "./Negate";
import { Signal } from "./Signal";
describe("Negate", () => {
BasicTests(Negate);
context("Negating", () => {
it("handles input and output connections", () => {
const negate = new Negate();
connectFrom().connect(negate);
negate.connect(connectTo());
negate.dispose();
});
it("negateates a positive value", () => {
return ConstantOutput(() => {
const signal = new Signal(1);
const negate = new Negate();
signal.connect(negate);
negate.toDestination();
}, -1);
});
it("makes a negateative value positive", () => {
return ConstantOutput(() => {
const signal = new Signal(-10);
const negate = new Negate();
signal.connect(negate);
negate.toDestination();
}, 10);
});
});
});