Skip to content

Commit

Permalink
Replace deprecated bodyParser.json() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
code-asher committed Sep 21, 2023
1 parent 4e0a5e7 commit a9028c9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/unit/node/proxy.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as bodyParser from "body-parser"
import * as express from "express"
import * as http from "http"
import nodeFetch from "node-fetch"
Expand Down Expand Up @@ -110,7 +109,7 @@ describe("proxy", () => {
})

it("should allow post bodies", async () => {
e.use(bodyParser.json({ strict: false }))
e.use(express.json({ strict: false }))
e.post("/wsup", (req, res) => {
res.json(req.body)
})
Expand All @@ -127,7 +126,7 @@ describe("proxy", () => {
})

it("should handle bad requests", async () => {
e.use(bodyParser.json({ strict: false }))
e.use(express.json({ strict: false }))
e.post("/wsup", (req, res) => {
res.json(req.body)
})
Expand All @@ -154,7 +153,7 @@ describe("proxy", () => {
})

it("should handle errors", async () => {
e.use(bodyParser.json({ strict: false }))
e.use(express.json({ strict: false }))
e.post("/wsup", (req, res) => {
throw new Error("BROKEN")
})
Expand Down

0 comments on commit a9028c9

Please sign in to comment.