Skip to content

Commit

Permalink
testing being constructed with different voices
Browse files Browse the repository at this point in the history
  • Loading branch information
tambien committed Oct 7, 2019
1 parent 6ba7fb7 commit 34f731b
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion Tone/instrument/PolySynth.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { expect } from "chai";
import { BasicTests, warns } from "test/helper/Basic";
import { CompareToFile } from "test/helper/CompareToFile";
import { InstrumentTest } from "test/helper/InstrumentTests";
import { atTime, Offline } from "test/helper/Offline";
import { OutputAudio } from "test/helper/OutputAudio";
import { PolySynth } from "./PolySynth";
import { Synth } from "./Synth";
import { FMSynth } from "./FMSynth";
import { PluckSynth } from "./PluckSynth";
import { MetalSynth } from "./MetalSynth";
import { MembraneSynth } from "./MembraneSynth";

describe("PolySynth", () => {

Expand Down Expand Up @@ -42,6 +45,25 @@ describe("PolySynth", () => {
}, "polySynth3.wav", 0.5);
});

it("can be constructed with monophonic synths", () => {
expect(() => {
const polySynth = new PolySynth(Synth);
polySynth.dispose();
}).to.not.throw(Error);
expect(() => {
const polySynth = new PolySynth(FMSynth);
polySynth.dispose();
}).to.not.throw(Error);
expect(() => {
const polySynth = new PolySynth(MetalSynth);
polySynth.dispose();
}).to.not.throw(Error);
expect(() => {
const polySynth = new PolySynth(MembraneSynth);
polySynth.dispose();
}).to.not.throw(Error);
});

context("Playing Notes", () => {

it("triggerAttackRelease can take an array of durations", () => {
Expand Down

0 comments on commit 34f731b

Please sign in to comment.