Skip to content

Commit a08ace0

Browse files
author
v1rtl
committed
bump deps and fix types
1 parent 26a342c commit a08ace0

4 files changed

Lines changed: 43 additions & 18 deletions

File tree

deno.lock

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export { expect } from 'https://deno.land/x/expect@v0.3.0/mod.ts'
2-
export {
3-
assertEquals,
4-
assertMatch,
5-
} from 'https://deno.land/std@0.182.0/testing/asserts.ts'
1+
export { expect } from 'https://deno.land/x/expect@v0.4.0/mod.ts'
2+
export { assertEquals } from 'https://deno.land/std@0.197.0/assert/assert_equals.ts'
3+
export { assertMatch } from 'https://deno.land/std@0.197.0/assert/assert_match.ts'

mod_test.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from 'https://deno.land/x/tincan@1.0.1/mod.ts'
77
import { makeFetch } from './mod.ts'
88
import { 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
1212
class 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
})

types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export type Handler = (
22
request: Request,
3-
connInfo: Deno.Conn
3+
connInfo: Deno.Conn,
44
) => Response | Promise<Response>
55

66
export type HandlerOrListener = Handler | Deno.Listener

0 commit comments

Comments
 (0)