Skip to content

Commit 8b416dc

Browse files
committed
11.2 body parser middleware
1 parent 2545801 commit 8b416dc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/server.test.js

+10
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ describe("server", () => {
140140
assert.equal(response.body.name,"FIRSTNAME LASTNAME");
141141
});
142142
});
143+
// 11.2
144+
it('should enable bodyParser middleware with "extended" set to false',async()=>{
145+
constserverFilePath=path.join(process.cwd(),"src","server.js");
146+
constserverFile=awaitreadFile(serverFilePath,"utf8");
147+
constbodyParserRegex=/app.use\((\s+)?bodyParser.urlencoded\({(\s+)?extended:false(\s+)?}\)(\s+)?\);/;
148+
assert.ok(
149+
serverFile.match(bodyParserRegex),
150+
"bodyParser middleware not found"
151+
);
152+
});
143153
after(()=>{
144154
server.close();
145155
});

0 commit comments

Comments
 (0)
close