Skip to content

Commit a9028c9

Browse files
committed
Replace deprecated bodyParser.json() usage
1 parent 4e0a5e7 commit a9028c9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/unit/node/proxy.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as bodyParser from "body-parser"
21
import * as express from "express"
32
import * as http from "http"
43
import nodeFetch from "node-fetch"
@@ -110,7 +109,7 @@ describe("proxy", () => {
110109
})
111110

112111
it("should allow post bodies", async () => {
113-
e.use(bodyParser.json({ strict: false }))
112+
e.use(express.json({ strict: false }))
114113
e.post("/wsup", (req, res) => {
115114
res.json(req.body)
116115
})
@@ -127,7 +126,7 @@ describe("proxy", () => {
127126
})
128127

129128
it("should handle bad requests", async () => {
130-
e.use(bodyParser.json({ strict: false }))
129+
e.use(express.json({ strict: false }))
131130
e.post("/wsup", (req, res) => {
132131
res.json(req.body)
133132
})
@@ -154,7 +153,7 @@ describe("proxy", () => {
154153
})
155154

156155
it("should handle errors", async () => {
157-
e.use(bodyParser.json({ strict: false }))
156+
e.use(express.json({ strict: false }))
158157
e.post("/wsup", (req, res) => {
159158
throw new Error("BROKEN")
160159
})

0 commit comments

Comments
 (0)