@@ -18,7 +18,6 @@ import { type Polka } from "polka";
18
18
19
19
// Import Internal Dependencies
20
20
import { buildServer } from "../index.js" ;
21
- import * as rootEndpoint from "../src/endpoints/root.js" ;
22
21
import * as flagsEndpoint from "../src/endpoints/flags.js" ;
23
22
24
23
// CONSTANTS
@@ -82,41 +81,6 @@ describe("httpServer", { concurrency: 1 }, () => {
82
81
assert . equal ( result . headers [ "content-type" ] , "text/html" ) ;
83
82
} ) ;
84
83
85
- test ( "'/' should fail" , async ( ctx ) => {
86
- class Response {
87
- body : string ;
88
- headers : Record < string , string > ;
89
- statusCode : number ;
90
-
91
- constructor ( ) {
92
- this . body = "" ;
93
- this . headers = { } ;
94
- this . statusCode = 200 ;
95
- }
96
- end ( str : string ) {
97
- this . body = str ;
98
- }
99
- writeHead ( int : number ) {
100
- this . statusCode = int ;
101
- }
102
- getHeader ( key : string ) {
103
- return this . headers [ key ] ;
104
- }
105
- }
106
-
107
- const fakeError = "fake error" ;
108
- function toThrow ( ) {
109
- throw new Error ( fakeError ) ;
110
- }
111
- ctx . mock . method ( Response . prototype , "writeHead" , toThrow , { times : 1 } ) ;
112
-
113
- const response : any = new Response ( ) ;
114
- await rootEndpoint . get ( { } as any , response ) ;
115
-
116
- assert . strictEqual ( response . body , JSON . stringify ( { error : fakeError } ) ) ;
117
- assert . strictEqual ( response . statusCode , 500 ) ;
118
- } ) ;
119
-
120
84
test ( "'/flags' should return the flags list as JSON" , async ( ) => {
121
85
const result = await get ( new URL ( "/flags" , kHttpURL ) ) ;
122
86
0 commit comments