mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 00:27:58 +00:00
bfc3d7ed15
more consistent with the Web Audio API
38 lines
954 B
TypeScript
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);
|
|
});
|
|
});
|
|
});
|