Skip to content

Commit

Permalink
improved the logic for unit testing in p5.gain
Browse files Browse the repository at this point in the history
  • Loading branch information
endurance21 committed Jun 6, 2020
1 parent dc10fda commit 5105f5f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/tests/p5.Gain.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ define(['chai'],(chai)=>{

mainGainNode.connect(outputNode);
});
it('can disconnect all output' ,()=>{
let inputNode = new p5.Gain();
let outputNode = new p5.Gain();
let mainGainNode = new p5.Gain();
it('can disconnect from the given output if present any' ,()=>{
let outputNode1 = new p5.Gain();
let mainGainNode1 = new p5.Gain();

mainGainNode1.connect(outputNode1);
mainGainNode1.disconnect(); // it disconnects from the output if present

let mainGainNode2 = new p5.Gain();
mainGainNode2.disconnect(); // the disconnects can handle things if there is no output too

mainGainNode.setInput(inputNode);
mainGainNode.connect(outputNode);
mainGainNode.disconnect();
});
it('can set the output level of gain Node', ()=>{
let osc = new p5.Oscillator('sine');
Expand Down

0 comments on commit 5105f5f

Please sign in to comment.