@@ -157,51 +157,51 @@ tap.test('SoundPlayer', suite => {
157157 audioContext . $processTo ( audioEngine . DECAY_DURATION ) ;
158158
159159 return Promise . resolve ( )
160- . then ( ( ) => {
160+ . then ( ( ) => {
161161
162- t . equal ( soundPlayer . outputNode . $state , 'PLAYING' ) ;
162+ t . equal ( soundPlayer . outputNode . $state , 'PLAYING' ) ;
163163
164- soundPlayer . play ( ) ;
165- soundPlayer . finished ( ) . then ( ( ) => log . push ( 'play 2 finished' ) ) ;
164+ soundPlayer . play ( ) ;
165+ soundPlayer . finished ( ) . then ( ( ) => log . push ( 'play 2 finished' ) ) ;
166166
167- // wait for a micro-task loop to fire our previous events
168- return Promise . resolve ( ) ;
169- } )
170- . then ( ( ) => {
167+ // wait for a micro-task loop to fire our previous events
168+ return Promise . resolve ( ) ;
169+ } )
170+ . then ( ( ) => {
171171
172- t . equal ( log [ 0 ] , 'play 1 finished' ) ;
173- t . notEqual ( soundPlayer . outputNode , firstPlayNode , 'created new player node' ) ;
172+ t . equal ( log [ 0 ] , 'play 1 finished' ) ;
173+ t . notEqual ( soundPlayer . outputNode , firstPlayNode , 'created new player node' ) ;
174174
175- t . equal ( help . engineInputs . length , 2 , 'there should be 2 players connected' ) ;
176- t . equal ( firstPlayNode . $state , 'PLAYING' ) ;
177- t . equal ( soundPlayer . outputNode . $state , 'PLAYING' ) ;
178- t . equal ( help . engineInputs [ 0 ] . gain . value , 1 , 'old sound connectect to gain node with volume 1' ) ;
175+ t . equal ( help . engineInputs . length , 2 , 'there should be 2 players connected' ) ;
176+ t . equal ( firstPlayNode . $state , 'PLAYING' ) ;
177+ t . equal ( soundPlayer . outputNode . $state , 'PLAYING' ) ;
178+ t . equal ( help . engineInputs [ 0 ] . gain . value , 1 , 'old sound connectect to gain node with volume 1' ) ;
179179
180- const { currentTime} = audioContext ;
181- audioContext . $processTo ( currentTime + audioEngine . DECAY_WAIT + 0.001 ) ;
182- t . notEqual ( help . engineInputs [ 0 ] . gain . value , 1 ,
183- 'old sound connected to gain node which will fade' ) ;
180+ const { currentTime} = audioContext ;
181+ audioContext . $processTo ( currentTime + audioEngine . DECAY_WAIT + 0.001 ) ;
182+ t . notEqual ( help . engineInputs [ 0 ] . gain . value , 1 ,
183+ 'old sound connected to gain node which will fade' ) ;
184184
185- audioContext . $processTo ( currentTime + audioEngine . DECAY_WAIT + audioEngine . DECAY_DURATION + 0.001 ) ;
186- t . equal ( soundPlayer . outputNode . $state , 'PLAYING' ) ;
187- t . equal ( firstPlayNode . $state , 'FINISHED' ) ;
185+ audioContext . $processTo ( currentTime + audioEngine . DECAY_WAIT + audioEngine . DECAY_DURATION + 0.001 ) ;
186+ t . equal ( soundPlayer . outputNode . $state , 'PLAYING' ) ;
187+ t . equal ( firstPlayNode . $state , 'FINISHED' ) ;
188188
189- t . equal ( help . engineInputs [ 0 ] . gain . value , 0 , 'faded old sound to 0' ) ;
189+ t . equal ( help . engineInputs [ 0 ] . gain . value , 0 , 'faded old sound to 0' ) ;
190190
191- t . equal ( log . length , 1 ) ;
192- audioContext . $processTo ( currentTime + audioEngine . DECAY_WAIT + audioEngine . DECAY_DURATION + 0.3 ) ;
191+ t . equal ( log . length , 1 ) ;
192+ audioContext . $processTo ( currentTime + audioEngine . DECAY_WAIT + audioEngine . DECAY_DURATION + 0.3 ) ;
193193
194- // wait for a micro-task loop to fire our previous events
195- return Promise . resolve ( ) ;
196- } )
197- . then ( ( ) => {
194+ // wait for a micro-task loop to fire our previous events
195+ return Promise . resolve ( ) ;
196+ } )
197+ . then ( ( ) => {
198198
199- t . equal ( log [ 1 ] , 'play 2 finished' ) ;
200- t . equal ( help . engineInputs . length , 1 , 'old sound disconneted itself after done' ) ;
201- t . equal ( log . length , 2 ) ;
199+ t . equal ( log [ 1 ] , 'play 2 finished' ) ;
200+ t . equal ( help . engineInputs . length , 1 , 'old sound disconneted itself after done' ) ;
201+ t . equal ( log . length , 2 ) ;
202202
203- t . end ( ) ;
204- } ) ;
203+ t . end ( ) ;
204+ } ) ;
205205 } ) ;
206206
207207 suite . end ( ) ;
0 commit comments