Skip to content
Snippets Groups Projects
Commit e6705e40 authored by Magomed Khatujevitsj Bakhmadov's avatar Magomed Khatujevitsj Bakhmadov
Browse files

Update persondao.test.js

parent 1b744c18
No related branches found
No related tags found
No related merge requests found
Pipeline #22887 failed
...@@ -26,6 +26,31 @@ afterAll(() => { ...@@ -26,6 +26,31 @@ afterAll(() => {
pool.end(); pool.end();
}); });
test("delete one person from db", done => {
function callback(err, rows) {
expect(affectedRows.length).toBe(rows.length - 1);
done();
}
personDao.deleteOne(1, callback);
});
test("update on person from db", done => {
function callback(status, data) {
console.log(
"Test callback: status=" + status + ", data=" + JSON.stringify(data)
);
expect(data[0].navn).toBe("Magomed Bakhmadov");
expect(data[0].adresse).toBe("Odd Brochmanns veg 1");
expect(data[0]).alder.toBe(20);
done();
}
personDao.updateOne(1,
{ navn: "Magomed Bakhmadov", adresse: "Odd Brochmanns veg 1", alder: 20 },
callback
);
});
test("get one person from db", done => { test("get one person from db", done => {
function callback(status, data) { function callback(status, data) {
console.log( console.log(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment