@@ -209,7 +209,7 @@ it('filters thumbnail cache files', async () => {
209209 expect ( items ) . toHaveLength ( 0 ) ;
210210} ) ;
211211
212- it ( 'should throw if reading dir entries fails' , async done => {
212+ it ( 'should throw if reading dir entries fails' , done => {
213213 const mockFiles = sortFiles ( [
214214 createFile ( 'ping.json' , { ping : true } ) ,
215215 createFile ( 'pong.json' , { pong : true } )
@@ -222,15 +222,12 @@ it('should throw if reading dir entries fails', async done => {
222222 ] , 1 , 1 ) )
223223 ] ) ;
224224
225- try {
226- await fromEvent ( evt ) ;
227- done . fail ( 'Getting the files should have failed' ) ;
228- } catch ( err ) {
229- done ( ) ;
230- }
225+ fromEvent ( evt )
226+ . then ( ( ) => done . fail ( 'Getting the files should have failed' ) )
227+ . catch ( ( ) => done ( ) ) ;
231228} ) ;
232229
233- it ( 'should throw if reading file entry fails' , async done => {
230+ it ( 'should throw if reading file entry fails' , done => {
234231 const mockFiles = sortFiles ( [
235232 createFile ( 'ping.json' , { ping : true } ) ,
236233 createFile ( 'pong.json' , { pong : true } )
@@ -243,24 +240,18 @@ it('should throw if reading file entry fails', async done => {
243240 ] , 1 , 1 ) )
244241 ] ) ;
245242
246- try {
247- await fromEvent ( evt ) ;
248- done . fail ( 'Getting the files should have failed' ) ;
249- } catch ( err ) {
250- done ( ) ;
251- }
243+ fromEvent ( evt )
244+ . then ( ( ) => done . fail ( 'Getting the files should have failed' ) )
245+ . catch ( ( ) => done ( ) ) ;
252246} ) ;
253247
254- it ( 'should throw if DataTransferItem is not a File' , async done => {
248+ it ( 'should throw if DataTransferItem is not a File' , done => {
255249 const item = dataTransferItem ( null , 'file' ) ;
256250 const evt = dragEvtFromFilesAndItems ( [ ] , [ item ] ) ;
257251
258- try {
259- await fromEvent ( evt ) ;
260- done . fail ( 'Getting the files should have failed' ) ;
261- } catch ( err ) {
262- done ( ) ;
263- }
252+ fromEvent ( evt )
253+ . then ( ( ) => done . fail ( 'Getting the files should have failed' ) )
254+ . catch ( ( ) => done ( ) ) ;
264255} ) ;
265256
266257
@@ -402,7 +393,7 @@ function inputEvtFromFiles(...files: File[]): Event {
402393 if ( p === 'target' ) {
403394 return input ;
404395 }
405- return t [ p ] ;
396+ return ( t as any ) [ p ] ;
406397 }
407398 } ) ;
408399}
0 commit comments