Skip to content
Snippets Groups Projects
Commit 52d1d8b7 authored by Øivind Haugerøy Larsson's avatar Øivind Haugerøy Larsson
Browse files

first delete test

parent a646399a
No related branches found
No related tags found
No related merge requests found
Pipeline #22827 failed with stages
in 59 seconds
......@@ -30,4 +30,12 @@ module.exports = class PersonDao extends Dao {
callback
)
}
deleteOne(id, callback) {
super.query(
"delete from person where id = ?",
[id],
callback
)
}
};
......@@ -96,4 +96,16 @@ test("update person from db", done => {
{navn: "Hei Heisen", adresse: "Gata 2", alder: "23"},
callback
);
})
test("delete person from db", done => {
function callback(staus, data) {
console.log(
"Test callback: status= " + status + ", data=" +JSON.stringify(data)
);
expect(personDao.getAll(callback)).toBe(1);
expect(data.affectedRows).toBeGreaterThanOrEqual(1);
done();
}
personDao.deleteOne(2, callback);
})
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment