1
- import * as bodyParser from "body-parser"
2
1
import * as express from "express"
3
2
import * as http from "http"
4
3
import nodeFetch from "node-fetch"
@@ -110,7 +109,7 @@ describe("proxy", () => {
110
109
} )
111
110
112
111
it ( "should allow post bodies" , async ( ) => {
113
- e . use ( bodyParser . json ( { strict : false } ) )
112
+ e . use ( express . json ( { strict : false } ) )
114
113
e . post ( "/wsup" , ( req , res ) => {
115
114
res . json ( req . body )
116
115
} )
@@ -127,7 +126,7 @@ describe("proxy", () => {
127
126
} )
128
127
129
128
it ( "should handle bad requests" , async ( ) => {
130
- e . use ( bodyParser . json ( { strict : false } ) )
129
+ e . use ( express . json ( { strict : false } ) )
131
130
e . post ( "/wsup" , ( req , res ) => {
132
131
res . json ( req . body )
133
132
} )
@@ -154,7 +153,7 @@ describe("proxy", () => {
154
153
} )
155
154
156
155
it ( "should handle errors" , async ( ) => {
157
- e . use ( bodyParser . json ( { strict : false } ) )
156
+ e . use ( express . json ( { strict : false } ) )
158
157
e . post ( "/wsup" , ( req , res ) => {
159
158
throw new Error ( "BROKEN" )
160
159
} )
0 commit comments