Skip to content

Commit 7646630

Browse files
committed
5. 1 json message
1 parent 6637203 commit 7646630

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎test/server.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@ describe("server", () => {
2323
assert.ok(response.text.match(/body {/));
2424
});
2525
});
26+
// 5.1
27+
it('should return json from the "/json" endpoint', () => {
28+
return request(server)
29+
.get("/json")
30+
.expect("Content-type", /application\/json/)
31+
.expect(200)
32+
.then(response => {
33+
assert.ok(response.body, "Body does not contain json");
34+
assert.equal(
35+
response.body.message,
36+
"Hello json",
37+
'Message should be "Hello json"'
38+
);
39+
});
40+
});
2641
after(() => {
2742
server.close();
2843
});

0 commit comments

Comments
 (0)