Skip to content

Commit 5e9e908

Browse files
committed
api.test.js updated
1 parent a937158 commit 5e9e908

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/api.test.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import source from "../db.json";
22
import { getUser } from "./api";
33
var nock = require("nock");
44
describe("getUser()", function() {
5-
it("getUser('AgileTest')", async function() {
6-
nock("http://localhost:5000")
7-
.defaultReplyHeaders({ "access-control-allow-origin": "*" })
8-
.get("/AgileTest")
9-
.reply(200, source);
5+
nock("http://localhost:5000")
6+
.defaultReplyHeaders({ "access-control-allow-origin": "*" })
7+
.get("/AgileTest")
8+
.reply(200, source);
9+
it("getUser('AgileTest') should return db.json", async function() {
1010
const res = await getUser("AgileTest");
1111
expect(res).toEqual(source);
12+
expect(res.name).toEqual(source.name);
1213
});
1314
});

0 commit comments

Comments
 (0)