@@ -8,7 +8,7 @@ describe('p5.PolySynth', function () {
8
8
polySynth . dispose ( ) ;
9
9
} ) ;
10
10
11
- it ( 'keeps track of the number of voicesInUse' , async function ( ) {
11
+ it ( 'keeps track of the number of voicesInUse' , function ( ) {
12
12
const polySynth = new p5 . PolySynth ( ) ;
13
13
const noteDuration = 0.01 ;
14
14
@@ -18,21 +18,17 @@ describe('p5.PolySynth', function () {
18
18
19
19
expect ( polySynth . _voicesInUse . getValueAtTime ( noteTriggerTime ) ) . to . equal ( 0 ) ;
20
20
21
- await polySynth . play ( 'A2' , 0 , 0 , noteDuration ) ;
21
+ polySynth . play ( 'A2' , 0 , 0 , noteDuration ) ;
22
22
expect ( polySynth . _voicesInUse . getValueAtTime ( noteActiveTime ) ) . to . equal ( 1 ) ;
23
- await polySynth . play ( 'A3' , 0 , 0 , noteDuration ) ;
24
- expect (
25
- await polySynth . _voicesInUse . getValueAtTime ( noteActiveTime )
26
- ) . to . equal ( 2 ) ;
27
- await polySynth . play ( 'A4' , 0 , 0 , noteDuration ) ;
28
- expect (
29
- await polySynth . _voicesInUse . getValueAtTime ( noteActiveTime )
30
- ) . to . equal ( 3 ) ;
31
-
32
- expect ( await polySynth . _voicesInUse . getValueAtTime ( noteDoneTime ) ) . to . equal (
33
- 0
34
- ) ;
35
-
36
- await polySynth . dispose ( ) ;
23
+ polySynth . play ( 'A3' , 0 , 0 , noteDuration ) ;
24
+ expect ( polySynth . _voicesInUse . getValueAtTime ( noteActiveTime ) ) . to . equal ( 2 ) ;
25
+ polySynth . play ( 'A4' , 0 , 0 , noteDuration ) ;
26
+ expect ( polySynth . _voicesInUse . getValueAtTime ( noteActiveTime ) ) . to . equal ( 3 ) ;
27
+
28
+ setTimeout ( ( ) => {
29
+ expect ( polySynth . _voicesInUse . getValueAtTime ( noteDoneTime ) ) . to . equal ( 0 ) ;
30
+ } , 10 ) ;
31
+
32
+ polySynth . dispose ( ) ;
37
33
} ) ;
38
34
} ) ;
0 commit comments