From a646399a899d051754fcff177e264b09ba56d272 Mon Sep 17 00:00:00 2001 From: oivindhl <oivindhl@stud.ntnu.no> Date: Tue, 25 Sep 2018 00:19:23 +0200 Subject: [PATCH] plisfunk --- dao/persondao.test.js | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/dao/persondao.test.js b/dao/persondao.test.js index ce08284..805ab05 100644 --- a/dao/persondao.test.js +++ b/dao/persondao.test.js @@ -75,24 +75,25 @@ test("get all persons from db", done => { done(); } - test("update person from db", done => { - function callback(status, data) { - personDao.getOne(2, getCallback); - } - - function getCallback(status, data) { - console.log( - "Test callback: status= " + status + ", data=" +JSON.stringify(data) - ); - expect(data.length).toBe(1); - expect(data[0].alder).toBe(23); - done(); - } - personDao.updateOne( - 2, - {navn: "Hei Heisen", adresse: "Gata 2", alder: "23"}, - callback - ); - }) personDao.getAll(callback); }); + +test("update person from db", done => { + function callback(status, data) { + personDao.getOne(2, getCallback); + } + + function getCallback(status, data) { + console.log( + "Test callback: status= " + status + ", data=" +JSON.stringify(data) + ); + expect(data.length).toBe(1); + expect(data[0].alder).toBe(23); + done(); + } + personDao.updateOne( + 2, + {navn: "Hei Heisen", adresse: "Gata 2", alder: "23"}, + callback + ); +}) \ No newline at end of file -- GitLab