1- // Copyright 2018-2024 the oak authors. All rights reserved. MIT license.
1+ // Copyright 2018-2025 the oak authors. All rights reserved. MIT license.
22
33import { assert } from "./assert.ts" ;
4- import { assertEquals } from "./deps_test.ts" ;
5- import { isHttpError } from "./http_errors.ts" ;
4+ import { assertEquals , assertInstanceOf } from "./deps_test.ts" ;
5+ import { HttpError , isHttpError } from "./http_errors.ts" ;
66import { Status } from "./status.ts" ;
77
88Deno . test ( {
@@ -34,6 +34,7 @@ Deno.test({
3434 try {
3535 assert ( false , "This is a custom message." ) ;
3636 } catch ( error ) {
37+ assertInstanceOf ( error , Error ) ;
3738 assertEquals ( error . message , "This is a custom message." ) ;
3839 }
3940 } ,
@@ -45,6 +46,7 @@ Deno.test({
4546 try {
4647 assert ( false , "This is a custom message." , Status . NotFound ) ;
4748 } catch ( error ) {
49+ assertInstanceOf ( error , HttpError ) ;
4850 assertEquals ( error . status , 404 ) ;
4951 assertEquals ( error . expose , true ) ;
5052 }
@@ -59,6 +61,7 @@ Deno.test({
5961 expose : false ,
6062 } ) ;
6163 } catch ( error ) {
64+ assertInstanceOf ( error , HttpError ) ;
6265 assertEquals ( error . expose , false ) ;
6366 }
6467 } ,
0 commit comments