Skip to content
Snippets Groups Projects
Commit fac8f167 authored by Herman Ryen Martinsen's avatar Herman Ryen Martinsen
Browse files

La til tester for update og delete

parent 6fdead9a
No related branches found
No related tags found
Loading
Checking pipeline status
......@@ -77,3 +77,31 @@ test("get all persons from db", done => {
personDao.getAll(callback);
});
test("update a person in the db", done => {
function callback(status, data) {
console.log(
"Test callback: status=" + status + ", data=" + JSON.stringify(data)
);
expect(data[0].navn).toBe("Test");
done();
}
personDao.updateOne(1,
{navn:"Test",adresse:"Gata 5",alder:45},
callback);
});
test("remove a person from db", done => {
function callback(status, data) {
console.log(
"Test callback: status=" + status + ", data=" + JSON.stringify(data)
);
expect(data.length).toBe(1);
done();
}
personDao.deleteOne(1, callback);
});
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