I am new to JavaScript/JavaScript testing and was doing a course on mocha test framework with chai. how to test simple CRUD application? I want to write unit tests for all of them. I tried looking at questions here, but all of them were very advanced and i did not understand them. can you please help me it would be appreciated. the question was
module.exports = {
addDetails: function() {
let data =[]
data.push("one");
return data
},
deleteDetails: function() {
let data =["one" , "two"]
data.splice(0 , 1)
return data
},
editDetails: function() {
let data =["one"]
data.splice(0 , 1 , "three")
return data
},
updateDetails: function() {
let data = ["one" , "three"]
data.splice(1 , 0 , "two")
return data
},
detailsPop: function() {
let numb = ["one" , "two"]
numb.pop()
return numb
},
concatData: function() {
let data1 = ["one"]
let data2 = ["two"]
let result = data1.concat(data2)
return result
}
}