Skip to content
Snippets Groups Projects
Commit 31b4bfc0 authored by Name's avatar Name
Browse files

test app.delete

parent ace90013
No related branches found
No related tags found
No related merge requests found
Pipeline #49719 failed
......@@ -78,15 +78,13 @@ test("get all persons from db", done => {
personDao.getAll(callback);
});
/*
test("set values of person in db", done => {
personDao.createOne(
{ navn: "Jens", alder: 34, adresse: "Gata 3" },
callback
);
function callback(status, data) {
console.log(
"Test callback: status=" + status + ", changed rows=" + data.changedRows
"Test callback: status=" + status + ", changed rows=" + data
);
expect(data.changedRows).toBe(1);
done();
......@@ -97,16 +95,21 @@ test("set values of person in db", done => {
callback
);
});
*/
test("delete person from db", done => {
function callback(status, data){
console.log(
"Test callback: status=" + status + ", changed rows=" + data.affectedRows
"Test callback: status=" + status + ", changed rows=" + JSON.stringify(data.affectedRows)
);
expect(data.affectedRows).toBe(1);
done();
}
personDao.deleteOne(id, callback);
personDao.createOne(
{ navn: "Jens", alder: 34, adresse: "Gata 3" },
(status, data) => {
personDao.deleteOne(data.insertId, callback);
}
);
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment