mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 00:27:58 +00:00
checking if connecting to a source with no inputs throws an error
This commit is contained in:
parent
d4bacbf4e8
commit
0dff2423e7
1 changed files with 11 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
import { PassesAudio } from "@tonejs/plot";
|
||||
import { expect } from "chai";
|
||||
import { Offline } from "test/helper/Offline";
|
||||
import { Oscillator } from "../source/oscillator/Oscillator";
|
||||
import { connect, disconnect } from "./Connect";
|
||||
import { Gain } from "./context/Gain";
|
||||
|
||||
|
@ -57,6 +58,16 @@ describe("Connect", () => {
|
|||
expect(threwError).to.equal(true);
|
||||
});
|
||||
|
||||
it ("throws an error if the destination has no input", () => {
|
||||
const source = new Oscillator();
|
||||
const gain = new Gain();
|
||||
expect(() => {
|
||||
gain.connect(source);
|
||||
}).to.throw(Error);
|
||||
gain.dispose();
|
||||
source.dispose();
|
||||
});
|
||||
|
||||
it("throws an error if things aren't connected to a specific channel", async () => {
|
||||
let threwError = false;
|
||||
await PassesAudio((context, input, output) => {
|
||||
|
|
Loading…
Reference in a new issue