66} from 'https://deno.land/x/tincan@1.0.1/mod.ts'
77import { makeFetch } from './mod.ts'
88import { Handler } from './types.ts'
9- import { AssertionError } from 'https://deno.land/std@0.182 .0/testing/asserts .ts'
9+ import { AssertionError } from 'https://deno.land/std@0.197 .0/assert/assertion_error .ts'
1010
1111// this simulates the listener
1212class PseudoListener {
@@ -37,9 +37,7 @@ class PseudoListener {
3737 this . conn = await this . #listener. accept ( )
3838 const httpConn = Deno . serveHttp ( this . conn )
3939 const requestEvent = await httpConn . nextRequest ( )
40- requestEvent ?. respondWith (
41- new Response ( 'hello' , { status : 200 } ) ,
42- )
40+ requestEvent ?. respondWith ( new Response ( 'hello' , { status : 200 } ) )
4341 resolve ( this . conn )
4442 } )
4543 }
@@ -207,7 +205,7 @@ describe('expectHeader', () => {
207205 } )
208206 it ( 'can expect array of header values' , async ( ) => {
209207 const handler : Handler = ( ) =>
210- new Response ( 'Hello World' , { headers : { 'A' : '1,2,3' } } )
208+ new Response ( 'Hello World' , { headers : { A : '1,2,3' } } )
211209 const fetch = makeFetch ( handler )
212210 const res = await fetch ( '/' )
213211 res . expectHeader ( 'A' , [ '1' , '2' , '3' ] )
@@ -260,7 +258,7 @@ describe('expect', () => {
260258 it ( 'uses expectHeader if two arguments' , async ( ) => {
261259 const handler : Handler = ( ) =>
262260 new Response ( 'Hello World' , {
263- ' headers' : { 'Content-Type' : 'text/plain' } ,
261+ headers : { 'Content-Type' : 'text/plain' } ,
264262 } )
265263 const fetch = makeFetch ( handler )
266264 const res = await fetch ( '/' )
@@ -286,9 +284,7 @@ describe('Deno listener', () => {
286284 const fetch = makeFetch ( listener as Deno . Listener )
287285 await fetch ( '/' )
288286 } catch ( e ) {
289- expect ( ( e as Error ) . message ) . toMatch (
290- 'Port cannot be found' ,
291- )
287+ expect ( ( e as Error ) . message ) . toMatch ( 'Port cannot be found' )
292288 if ( listener . conn ?. rid ) Deno . close ( listener . conn ?. rid + 1 )
293289 listener . close ( )
294290 }
@@ -322,9 +318,7 @@ describe('Port randomness', () => {
322318 const fetch = makeFetch ( handler )
323319 await fetch ( '/' )
324320 } catch ( e ) {
325- expect ( ( e as Error ) . message ) . toMatch (
326- 'Unable to get free port' ,
327- )
321+ expect ( ( e as Error ) . message ) . toMatch ( 'Unable to get free port' )
328322 }
329323 } )
330324} )
0 commit comments