mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-27 20:13:07 +00:00
aaf880c925
* WIP moving tests to web-test-runner * updating thresholds * Adding file extensions * Testing integrations * linting * fixing dep * moving back to root dir * prettier all of the files * updating eslint rules to use with prettier * remove import package * moving tsignore around * removing unneeded ignores * all tests run on puppeteer, no need for testing guards * linting * import type syntax * cleaning up * Update package.json
28 lines
800 B
TypeScript
28 lines
800 B
TypeScript
import { Gain } from "../../Tone/core/context/Gain.js";
|
|
import { ToneAudioNode } from "../../Tone/core/context/ToneAudioNode.js";
|
|
|
|
export function connectFrom(): Gain {
|
|
return new Gain();
|
|
}
|
|
|
|
export function connectTo(): Gain {
|
|
return new Gain();
|
|
}
|
|
|
|
export function ConnectTest(constr, ...args: any[]): void {
|
|
it("handles input and output connections", () => {
|
|
const instance = new constr(...args);
|
|
// test each of the input and outputs and connect
|
|
if (instance.numberOfInputs) {
|
|
for (let input = 0; input < instance.numberOfInputs; input++) {
|
|
connectFrom().connect(instance, 0, input);
|
|
}
|
|
}
|
|
if (instance.numberOfOutputs) {
|
|
for (let output = 0; output < instance.numberOfOutputs; output++) {
|
|
instance.connect(connectTo(), output, 0);
|
|
}
|
|
}
|
|
instance.dispose();
|
|
});
|
|
}
|